From e3017e522a2080768e8e565408c8c5b0c2cfb788 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 13 Jan 2017 17:27:54 +0000 Subject: [PATCH] re PR c++/71166 (ICE with nested constexpr/initializer) PR c++/71166 * g++.dg/cpp0x/constexpr-array18.C: New test. From-SVN: r244450 --- gcc/testsuite/ChangeLog | 5 ++++ .../g++.dg/cpp0x/constexpr-array18.C | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-array18.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dba6a2c0d3b..e3f4499e634 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-13 Marek Polacek + + PR c++/71166 + * g++.dg/cpp0x/constexpr-array18.C: New test. + 2017-01-13 Janne Blomqvist PR fortran/78534 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array18.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array18.C new file mode 100644 index 00000000000..0f2d86e77d8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array18.C @@ -0,0 +1,23 @@ +// PR c++/71166 +// { dg-do compile { target c++11 } } + +struct Foo { int value; }; + +constexpr Foo MakeFoo() { return Foo{0}; } + +struct Bar { + Foo color = MakeFoo(); +}; + +struct BarContainer { + Bar array[1]; +}; + +Foo X () +{ + return MakeFoo (); +} + +void Foo() { + new BarContainer(); +} -- 2.30.2