* init.c (build_vec_init): Fix constant initialization of trailing elements. (build_value_init_noctor): Call maybe_constant_init. * semantics.c (maybe_constant_init): See through EXPR_STMT and conversion to void. From-SVN: r213690
23 lines
290 B
C
23 lines
290 B
C
// { dg-do run { target c++11 } }
|
|
|
|
struct A { int i,j; };
|
|
|
|
struct X {
|
|
A a = {1,1};
|
|
};
|
|
|
|
constexpr X table[2][2] = {{ {} }};
|
|
|
|
#define SA(X) static_assert(X,#X)
|
|
SA(table[1][1].a.i == 1);
|
|
|
|
extern "C" void abort();
|
|
|
|
const int *p = &table[1][1].a.j;
|
|
|
|
int main()
|
|
{
|
|
if (*p != 1)
|
|
abort();
|
|
}
|