8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array12.C
Jason Merrill c75ce5301b constexpr.c (cxx_eval_store_expression): Don't set CONSTRUCTOR_NO_IMPLICIT_ZERO if we have an enclosing CONSTRUCTOR...
* constexpr.c (cxx_eval_store_expression): Don't set
	CONSTRUCTOR_NO_IMPLICIT_ZERO if we have an enclosing CONSTRUCTOR
	without it.
	(cxx_eval_array_reference): Check it.

From-SVN: r226948
2015-08-17 14:41:59 -04:00

9 lines
180 B
C

// { dg-do compile { target c++11 } }
struct A { int ar[3]; };
int main()
{
constexpr A a1 = { 0, a1.ar[0] };
constexpr A a2 = { a2.ar[0] }; // { dg-error "uninitialized" }
}