gcc/testsuite/gcc.dg/gnu23-tag-composite-3.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -std=gnu23" } */ |
| 3 | |
| 4 | // struct with variably-modified member |
| 5 | |
| 6 | struct s { char (*y)[]; } s; |
| 7 | |
| 8 | int |
| 9 | foo () |
| 10 | { |
| 11 | int n = 10; |
| 12 | struct s { char (*y)[n]; } t; |
| 13 | typeof(*(1 ? &s : &t)) u; |
| 14 | return sizeof(*u.y); |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | if (10 != foo()) |
| 20 | __builtin_abort(); |
| 21 | |
| 22 | return 0; |
| 23 | } |
| 24 |