gcc/testsuite/gcc.dg/pr93577-3.c
raw| 1 | /* Test ICE with variable-size struct initializer: bug 93577. */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "" } */ |
| 4 | |
| 5 | void |
| 6 | f (int c) |
| 7 | { |
| 8 | struct s |
| 9 | { |
| 10 | int a; |
| 11 | int x[c]; |
| 12 | struct |
| 13 | { |
| 14 | int a, b; |
| 15 | } nest; |
| 16 | } v = { .a = 2, .nest.b = 1 }; /* { dg-error "variable-sized object may not be initialized" } */ |
| 17 | } |