From ef0981b8aea59164340d4d57b4e48b6810cc41fb Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 29 Aug 2014 13:12:02 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-56991.C | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-56991.C 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 }; -- 2.30.2