Add -Wshadow=global -Wshadow=local and -Wshadow=compatible-local.
[gcc.git] / gcc / testsuite / gcc.dg / Wshadow-local-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-Wshadow=local" } */
3
4 int decl1; /* should not warn */
5 void foo (double decl1) /* should not warn */
6 {
7 }
8
9 void foo2 (int d) /* { dg-message "shadowed declaration" } */
10 {
11 {
12 double d; /* { dg-warning "shadows a parameter" } */
13 }
14 }
15
16 void foo3 ()
17 {
18 int local; /* { dg-message "shadowed declaration" } */
19 {
20 int local; /* { dg-warning "shadows a previous local" } */
21 }
22 }