re PR c++/56633 (Overload selection error for non-static data member initialization...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 26 Jun 2014 15:34:59 +0000 (15:34 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 26 Jun 2014 15:34:59 +0000 (15:34 +0000)
2014-06-26  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/56633
* g++.dg/cpp0x/deleted8.C: New.

From-SVN: r212037

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/deleted8.C [new file with mode: 0644]

index bb05f7f..b64487b 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/56633
+       * g++.dg/cpp0x/deleted8.C: New.
+
 2014-06-26  Martin Jambor  <mjambor@suse.cz>
 
        * g++.dg/simulate-thread/bitfields-2.C: Remove allow-load-data-races
diff --git a/gcc/testsuite/g++.dg/cpp0x/deleted8.C b/gcc/testsuite/g++.dg/cpp0x/deleted8.C
new file mode 100644 (file)
index 0000000..a16f9fd
--- /dev/null
@@ -0,0 +1,22 @@
+// PR c++/56633
+// { dg-do compile { target c++11 } }
+
+struct A {
+  A(int) { }
+  A(const A&) = delete;
+};
+
+struct Test1 {
+    A value2{0}; // no problem here
+};
+
+template <typename T> // T is not used
+struct Test2 {
+    A value2{0}; // fails to compile
+};
+
+int main() {
+    Test1 test;
+    Test2<int> test2;
+    return 0;
+}