1 /* { dg-do compile } */ 2 /* { dg-options "-Wc++-compat" } */ 3 4 struct s1 5 { 6 enum e1 /* { dg-message "note: enum type defined here" } */ 7 { 8 A, /* { dg-message "note: enum constant defined here" } */ 9 B 10 } f1; 11 struct s2 /* { dg-message "note: struct defined here" } */ 12 { 13 struct s3 /* { dg-message "note: struct defined here" } */ 14 { 15 enum e1 f3; 16 struct s1 *p1; 17 struct s2 *p2; 18 struct s3 *p3; 19 } f2; 20 union u1 /* { dg-message "note: union defined here" } */ 21 { 22 int f4; 23 } f5; 24 struct s3 f6; 25 } f7; 26 struct s2 f8; 27 enum e1 f9; 28 }; 29 30 struct s1 v1; 31 enum e1 v2; /* { dg-warning "not visible in C\[+\]\[+\]" } */ 32 struct s2 v3; /* { dg-warning "not visible in C\[+\]\[+\]" } */ 33 struct s3 v4; /* { dg-warning "not visible in C\[+\]\[+\]" } */ 34 union u1 v5; /* { dg-warning "not visible in C\[+\]\[+\]" } */ 35 int i = A; /* { dg-warning "not visible in C\[+\]\[+\]" } */ 36