111
|
1 /* { dg-do compile } */
|
|
2 /* { dg-options -Wshadow=local } */
|
|
3
|
|
4 struct status
|
|
5 {
|
|
6 int member;
|
|
7 void foo2 ();
|
|
8
|
|
9 inline static int foo3 (int member)
|
|
10 {
|
|
11 return member;
|
|
12 }
|
|
13 };
|
|
14
|
|
15 int decl1; // { dg-bogus "shadowed declaration" }
|
|
16 int decl2; // { dg-bogus "shadowed declaration" }
|
|
17 void foo (struct status &status,
|
|
18 double decl1) // { dg-bogus "shadows a global" }
|
|
19 {
|
|
20 }
|
|
21
|
|
22 void foo1 (int d)
|
|
23 {
|
|
24 double d; // { dg-error "shadows a parameter" }
|
|
25 }
|
|
26
|
|
27 void status::foo2 ()
|
|
28 {
|
|
29 int member; // { dg-bogus "shadows a member" }
|
|
30 int decl2; // { dg-bogus "shadows a global" }
|
|
31 int local; // { dg-message "note: shadowed declaration is here" }
|
|
32 {
|
|
33 int local; // { dg-warning "shadows a previous local" }
|
|
34 }
|
|
35 }
|