8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array18.C
Marek Polacek e3017e522a re PR c++/71166 (ICE with nested constexpr/initializer)
PR c++/71166
	* g++.dg/cpp0x/constexpr-array18.C: New test.

From-SVN: r244450
2017-01-13 17:27:54 +00:00

24 lines
283 B
C

// 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();
}