Debian Codegraph @

gcc/testsuite/gcc.dg/gnu23-tag-composite-2.c

raw
1 /* { dg-do compile }
2 * { dg-options "-std=c23" }
3 */
4
5 // attributes
6
7 struct [[gnu::designated_init]] buf { char x; };
8
9 struct buf s = { 0 }; /* { dg-warning "positional" } */
10
11 void j()
12 {
13 struct buf { char x; } t = { 0 };
14 typeof(*(1 ? &s : &t)) u = { 0 }; /* { dg-warning "positional" } */
15 typeof(*(1 ? &t : &s)) v = { 0 }; /* { dg-warning "positional" } */
16 }
17
18
19 struct bar { struct buf y; };
20 extern struct bar a;
21 struct bar a = { { 0 } }; /* { dg-warning "positional" } */
22
23 void k()
24 {
25 struct buf { char x; } t = { 0 };
26 struct bar { struct buf y; } b;
27 extern typeof(*(1 ? &a : &b)) a;
28 typeof(*(1 ? &a : &b)) c = { { 0 } }; /* { dg-warning "positional" } */
29 }
30