]>
Commit | Line | Data |
---|---|---|
584ef5fe | 1 | /* { dg-do compile } */ |
e7b6a0ee | 2 | /* { dg-options "" } */ |
584ef5fe RH |
3 | |
4 | /* Verify that we can't do things to get ourselves in trouble | |
00de56c7 | 5 | with GCC's initialized flexible array member extension. */ |
584ef5fe | 6 | |
00de56c7 | 7 | struct f { int w; int x[]; }; |
584ef5fe RH |
8 | struct g { struct f f; }; |
9 | struct g g1 = { { 0, { } } }; | |
b1b8a185 | 10 | struct g g2 = { { 0, { 1 } } }; /* { dg-error "nested context" "nested" } */ |
d7ff7ae5 | 11 | /* { dg-message "near init" "near" { target *-*-* } 10 } */ |
00de56c7 | 12 | struct h { int x[0]; int y; }; |
b1b8a185 | 13 | struct h h1 = { { 0 }, 1 }; /* { dg-warning "excess elements" "excess" } */ |
d7ff7ae5 | 14 | /* { dg-message "near init" "before end" { target *-*-* } 13 } */ |