1 /* { dg-do-compile } */
2 /* { dg-additional-options "-Wshadow=local -Wno-shadow=compatible-local" } */
3 int c;
4 void foo(int *c, int *d) /* { dg-bogus "Wshadow" } */
5 {
6 int *e = d;
7 {
8 int d = 0; /* { dg-warning "Wshadow=local" } */
9 }
10 {
11 int *e = 0; /* { dg-bogus "Wshadow=compatible-local" } */
12 }
13 }
14 #pragma GCC diagnostic warning "-Wshadow"
15 void bar(int *c, int *d) /* { dg-warning "Wshadow" } */
16 {
17 int *e = d;
18 {
19 int d = 0; /* { dg-warning "Wshadow" } */
20 }
21 {
22 int *e = 0; /* { dg-warning "Wshadow" } */
23 }
24 }