re PR c++/56991 (constexpr std::initializer_list rejects too complex initialization)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 29 Aug 2014 13:12:02 +0000 (13:12 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 29 Aug 2014 13:12:02 +0000 (13:12 +0000)
2014-08-29  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/56991
* g++.dg/cpp0x/constexpr-56991.C: New.

From-SVN: r214729

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

index 0cf20a760c0d74f0a5827a13033fcc5ded8d305d..3d774a075c14d32cb4b32ae30407a673c9135056 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/56991
+       * g++.dg/cpp0x/constexpr-56991.C: New.
+
 2014-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/57764
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-56991.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-56991.C
new file mode 100644 (file)
index 0000000..a6043bc
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/56991
+// { dg-do compile { target c++11 } }
+
+#include <initializer_list>
+
+constexpr std::initializer_list<int> good1 = { 1, 2, 3 };
+struct foo { int a, b; };
+constexpr foo good2 = { 1, 2 };
+
+constexpr std::initializer_list<foo> bad1 = { { 1, 2 }, { 3, 4} };
+constexpr std::initializer_list<foo> bad2 = { good2, good2 };