2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / array-2.c
blobf207af58d41fbb19872566eed1fcb8e70a53ae31
1 /* { dg-do compile } */
2 /* { dg-options "" } */
4 /* Verify that we can't do things to get ourselves in trouble
5 with GCC's initialized flexible array member extension. */
7 struct f { int w; int x[]; };
8 struct g { struct f f; };
9 struct g g1 = { { 0, { } } };
10 struct g g2 = { { 0, { 1 } } }; /* { dg-error "nested context" "nested" } */
11 /* { dg-message "near init" "near" { target *-*-* } .-1 } */
12 struct h { int x[0]; int y; };
13 struct h h1 = { { 0 }, 1 }; /* { dg-warning "excess elements" "excess" } */
14 /* { dg-message "near init" "before end" { target *-*-* } .-1 } */