2018-01-24 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr17188-1.c
blob522a14f7d75f89eff8ba4e73aa78e8a1980d39c1
1 /* A redefinition of an empty struct should be diagnosed the same as a
2 redefinition of any other tag, but formerly only s2 and s4 were
3 diagnosed. Bug 17188. */
4 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "" } */
8 struct s0 { }; /* { dg-message "note: originally defined here" } */
9 struct s0;
10 struct s0 { }; /* { dg-error "redefinition of 'struct s0'" } */
12 struct s1 { }; /* { dg-message "note: originally defined here" } */
13 struct s1 { }; /* { dg-error "redefinition of 'struct s1'" } */
15 struct s2 { int a : 1; }; /* { dg-message "note: originally defined here" } */
16 struct s2 { int a : 1; }; /* { dg-error "redefinition of 'struct s2'" } */
18 struct s3 { }; /* { dg-message "note: originally defined here" } */
19 struct s3 { int a : 1; }; /* { dg-error "redefinition of 'struct s3'" } */
21 struct s4 { int a : 1; }; /* { dg-message "note: originally defined here" } */
22 struct s4 { }; /* { dg-error "redefinition of 'struct s4'" } */
24 struct s5 { int a : 1; };
25 struct s5;
27 struct s6;
28 struct s6 { int a : 1; };
30 struct s7;
31 struct s7 { };