aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu2x-constexpr-1.c
blob: 834f90e3e7938f270fdf0665bec19e6b74d4abb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Test C23 constexpr.  Valid code using GNU extensions, compilation tests.  */
/* { dg-do compile } */
/* { dg-options "-std=gnu23" } */

struct s { struct { int x, y; } x; };
constexpr struct s v = { { 123, 150 } };
int k;
constexpr int a[200] = { [v.x.x ... v.x.y] = 7 };

void
f ()
{
  switch (k)
    {
    case v.x.x ... v.x.y: ;
    }
}