Debian Codegraph @

gcc/testsuite/gcc.dg/c23-tag-2.c

raw
1 /* { dg-do compile }
2 * { dg-options "-std=c23" }
3 */
4
5 // compatibility of structs in assignment
6
7 typedef struct p { int a; } pd_t;
8
9 void test1(void)
10 {
11 pd_t y0;
12 struct p { int a; } x;
13 y0 = x;
14 }
15
16 void test2(void)
17 {
18 struct p { int a; } x;
19 struct p y0 = x;
20 }
21
22 void test3(void)
23 {
24 struct p { int a; } x;
25 pd_t y0 = x;
26 }
27
28 typedef struct p { int a; } p2_t;
29
30 void test4(void)
31 {
32 p2_t x;
33 pd_t y0 = x;
34 }
35
36 void test5(void)
37 {
38 struct q { int a; } a;
39 struct q { int a; } b;
40 a = b;
41 }
42
43