Debian Codegraph @

gcc/testsuite/gcc.dg/c23-tag-composite-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-std=c23" } */
3
4 void b(void)
5 {
6 int n = 3;
7
8 extern struct f { char (*x)[3]; char (*y)[]; } q;
9 { extern struct f { char (*x)[]; char (*y)[4]; } q;
10 _Static_assert(3 == sizeof(*q.x), "");
11 _Static_assert(4 == sizeof(*q.y), "");
12 }
13 { extern struct f { char (*x)[2]; char (*y)[]; } q; (void)q; } /* { dg-error "conflicting" } */
14
15 { struct f { char (*x)[n]; char (*y)[3]; }* qp = &q; (void)*qp; }
16 (void)q;
17
18 static struct g { int a; char buf[n]; } *p; (void)p;
19 { static struct g { int a; char buf[3]; } *p; (void)p; }
20
21 static struct h { int a; void (*s)(char buf[n]); } *t; (void)t;
22 { static struct h { int a; void (*s)(char buf[3]); } *t; (void)t; }
23 }
24
25
26