re PR c++/71966 (ICE on invalid C++11 code (undefined constructor used in a constant...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 9 Mar 2017 11:51:29 +0000 (11:51 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 9 Mar 2017 11:51:29 +0000 (11:51 +0000)
2017-03-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71966
* g++.dg/cpp0x/pr71966-1.C: New.
* g++.dg/cpp0x/pr71966-2.C: Likewise.

From-SVN: r246000

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr71966-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr71966-2.C [new file with mode: 0644]

index f576273..98f8733 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/71966
+       * g++.dg/cpp0x/pr71966-1.C: New.
+       * g++.dg/cpp0x/pr71966-2.C: Likewise.
+
 2017-03-09  Martin Liska  <mliska@suse.cz>
 
        PR tree-optimization/79631
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71966-1.C b/gcc/testsuite/g++.dg/cpp0x/pr71966-1.C
new file mode 100644 (file)
index 0000000..7632720
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/71966
+// { dg-do compile { target c++11 } }
+
+struct A
+{ 
+  constexpr A (int);  // { dg-message "never defined" }
+  constexpr operator int () const { return 0; }
+};
+
+template < int > struct B {};
+
+constexpr A a = 0;  // { dg-error "before its definition" }
+B < a > b;
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71966-2.C b/gcc/testsuite/g++.dg/cpp0x/pr71966-2.C
new file mode 100644 (file)
index 0000000..aedd4ce
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/71966
+// { dg-do compile { target c++11 } }
+
+struct A
+{ 
+  constexpr A (int);  // { dg-message "never defined" }
+  constexpr operator int () const { return 0; }
+  int c;
+};
+
+template <int>
+struct B {};
+
+constexpr A a = 0;  // { dg-error "before its definition" }
+B<a> b;