Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wshadow-5.C
blob7a90ec9c99760dfbcb2c4c2751f1495132cc88c9
1 // Wshadows was giving warnings for nested function parameters in nested class
2 // or structure that we didn't want.
3 // { dg-do compile }
4 // { dg-options "-Wshadow" }
6 // PR c++/41825
7 int f (int n)
9     int bar (int n) { return n++; } // { dg-error "a function-definition is not allowed here" }
10     return bar (n); // { dg-error "12:'bar' was not declared in this scope" }
13 int g (int i)
15     struct {
16         int bar (int i) { return i++; } // { dg-bogus "shadows" }
17     } s;
19     return s.bar (i);
22 // PR c++/30566
23 void h( int x )
25   class InnerClass
26     {
27       public:
28               static int g( int x ) // { dg-bogus "shadows" }
29                 {
30                   // empty
31                 }
32     };