Debian Codegraph @

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

raw
1 /*
2 * { dg-do compile }
3 * { dg-options "-std=c23" }
4 */
5
6 // conflicting types for anonymous structs / unions
7
8 extern struct { int x; } a;
9 extern struct { int x; } a; /* { dg-error "conflicting types" } */
10
11 extern union { int x; } b;
12 extern union { int x; } b; /* { dg-error "conflicting types" } */
13
14 typedef struct { int x; } u;
15 typedef struct { int x; } v;
16
17 u c;
18 v c; /* { dg-error "conflicting types" } */
19
20 typedef union { int x; } q;
21 typedef union { int x; } r;
22
23 q d;
24 r d; /* { dg-error "conflicting types" } */
25
26