From: Paolo Carlini Date: Fri, 29 Aug 2014 13:12:02 +0000 (+0000) Subject: re PR c++/56991 (constexpr std::initializer_list rejects too complex initialization) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef0981b8aea59164340d4d57b4e48b6810cc41fb;p=gcc.git re PR c++/56991 (constexpr std::initializer_list rejects too complex initialization) 2014-08-29 Paolo Carlini PR c++/56991 * g++.dg/cpp0x/constexpr-56991.C: New. From-SVN: r214729 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0cf20a760c0..3d774a075c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-08-29 Paolo Carlini + + PR c++/56991 + * g++.dg/cpp0x/constexpr-56991.C: New. + 2014-08-29 Paolo Carlini 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 index 00000000000..a6043bce5cc --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-56991.C @@ -0,0 +1,11 @@ +// PR c++/56991 +// { dg-do compile { target c++11 } } + +#include + +constexpr std::initializer_list good1 = { 1, 2, 3 }; +struct foo { int a, b; }; +constexpr foo good2 = { 1, 2 }; + +constexpr std::initializer_list bad1 = { { 1, 2 }, { 3, 4} }; +constexpr std::initializer_list bad2 = { good2, good2 };