1 /* { dg-do compile } */ 2 /* { dg-options "-Wc++-compat" } */ 3 int v1; /* { dg-message "previous declaration" } */ 4 int v1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ 5 int v2; /* { dg-message "previous declaration" } */ 6 int v2 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ 7 extern int v3; 8 int v3; /* { dg-message "previous declaration" } */ 9 int v3 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ 10 extern int v4; 11 int v4 = 1; 12 static int v5; /* { dg-message "previous declaration" } */ 13 static int v5; /* { dg-warning "invalid in C\[+\]\[+\]" } */ 14 static int v6; /* { dg-message "previous declaration" } */ 15 static int v6 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ 16 int v7; 17 extern int v7; 18 int v8 = 1; 19 extern int v8; 20