1 /* Copyright (C) 2001, 2002 Free Software Foundation, Inc. */
3 /* { dg-do compile } */
4 /* { dg-options -Wshadow } */
6 /* Source: Neil Booth, 3 Nov 2001, and PR 16, 713. -Wshadow was
7 giving a bunch of warnings we didn't want, and wasn't giving the
8 location of the shadowed variable. */
10 struct status // { dg-bogus "shadowed declaration" }
15 inline static int foo3 (int member) // { dg-bogus "shadows" }
21 int decl1; // { dg-warning "shadowed declaration" }
22 int decl2; // { dg-warning "shadowed declaration" }
23 void foo (struct status &status,// { dg-bogus "shadows a global decl" }
24 double decl1) // { dg-warning "shadows a global decl" }
30 double d; // { dg-error "shadows a parameter" }
35 int member; // { dg-warning "shadows a member" }
36 int decl2; // { dg-warning "shadows a global decl" }
37 int local; // { dg-warning "shadowed declaration" }
39 int local; // { dg-warning "shadows a previous local" }