1 /* Test diagnosis of nested tag redefinitions. */
2 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "" } */
7 struct s0
{ int a
; } x
; /* { dg-error "nested redefinition of 'struct s0'" } */
11 const struct s1
{ int b
; } x
; /* { dg-error "nested redefinition of 'struct s1'" } */
15 struct s2
{ int c
; } *x
; /* { dg-error "nested redefinition of 'struct s2'" } */
21 struct s3
{ int a
; } **x
; /* { dg-error "nested redefinition of 'struct s3'" } */
27 struct s6
{ struct s6
*p
; };
30 union u0
{ int c
; } *x
; /* { dg-error "nested redefinition of 'union u0'" } */
34 E0
= sizeof(enum e0
{ E1
}) /* { dg-error "nested redefinition of 'enum e0'" } */
38 E2
= sizeof(enum e2
{ E2
}), /* { dg-error "redeclaration of enumerator 'E2'" } */
39 /* { dg-error "previous definition" "previous E2" { target *-*-* } 38 } */