gcc/testsuite/gcc.dg/gnu23-constexpr-1.c
raw| 1 | /* Test C23 constexpr. Valid code using GNU extensions, compilation tests. */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-std=gnu23" } */ |
| 4 | |
| 5 | struct s { struct { int x, y; } x; }; |
| 6 | constexpr struct s v = { { 123, 150 } }; |
| 7 | int k; |
| 8 | constexpr int a[200] = { [v.x.x ... v.x.y] = 7 }; |
| 9 | |
| 10 | void |
| 11 | f () |
| 12 | { |
| 13 | switch (k) |
| 14 | { |
| 15 | case v.x.x ... v.x.y: ; |
| 16 | } |
| 17 | } |