testsuite: i386: adapt to -std=gnu23 default change
[official-gcc.git] / gcc / testsuite / gcc.dg / Wcxx-compat-10.c
blob0f1d037bfeac7f868dd88e2e780ecab8351ba127
1 /* { dg-do compile } */
2 /* { dg-options "-Wc++-compat" } */
4 struct s1 { int f; };
5 typedef int s2;
6 void
7 f1 ()
9 typedef int s1;
10 struct s2 { int f; };
13 struct s3 { int f; };
14 typedef struct s3 s3;
16 typedef struct s4 s4;
17 struct s4 { int f; };
19 struct s5 { int f; }; /* { dg-message "note: originally defined here" } */
20 typedef int s5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
22 typedef int s6; /* { dg-message "note: originally defined here" } */
23 struct s6 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
25 void
26 f2 ()
28 struct s7 { int f; }; /* { dg-message "note: originally defined here" } */
29 typedef int s7; /* { dg-warning "invalid in C\[+\]\[+\]" } */
31 typedef int s8; /* { dg-message "note: originally defined here" } */
32 struct s8 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
34 struct s9 { int f; };
35 { typedef int s9; }
37 typedef int s10;
38 { struct s10 { int f; }; }
41 enum e1 { A };
42 typedef int e2;
43 void
44 f3 ()
46 typedef int e1;
47 enum e2 { B };
50 enum e3 { C };
51 typedef enum e3 e3;
53 enum e5 { E }; /* { dg-message "note: originally defined here" } */
54 typedef int e5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
56 typedef int e6; /* { dg-message "note: originally defined here" } */
57 enum e6 { F }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
59 void
60 f4 ()
62 enum e7 { G }; /* { dg-message "note: originally defined here" } */
63 typedef int e7; /* { dg-warning "invalid in C\[+\]\[+\]" } */
65 typedef int e8; /* { dg-message "note: originally defined here" } */
66 enum e8 { H }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
68 enum e9 { I };
69 { typedef int e9; }
71 typedef int e10;
72 { enum e10 { J }; }