1 /* { dg-do compile } */
2 /* { dg-options "-Wshadow=compatible-local" } */
7 struct Bar bar
; /* { dg-bogus "shadowed declaration" } */
9 int val
; /* { dg-bogus "shadowed declaration" } */
11 int func1(int x
) { /* { dg-bogus "shadowed declaration" } */
12 int val
; /* { dg-bogus "shadows a global" } */
18 int a
= 3; /* { dg-message "shadowed declaration" } */
19 int j
; /* { dg-message "shadowed declaration" } */
21 for (j
= 0; j
< i
; ++j
) {
22 int a
= j
; /* { dg-warning "shadows a previous local" } */
23 int j
= a
+ 1; /* { dg-warning "shadows a previous local" } */
31 struct Bar bar
; /* { dg-bogus "shadowed declaration" } */
33 int bar
; /* { dg-bogus "shadows a previous local" } */