| 1 |
// PR c++/39526 |
| 2 |
// { dg-options "-Wshadow" } |
| 3 |
|
| 4 |
class INetURLObject |
| 5 |
{ |
| 6 |
public: |
| 7 |
INetURLObject(int i); |
| 8 |
int GetMainURL() const; |
| 9 |
}; |
| 10 |
|
| 11 |
int foo(int infoo) // { dg-bogus "shadowed declaration" } |
| 12 |
{ |
| 13 |
int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" } |
| 14 |
extern void f(int infoo); |
| 15 |
struct A |
| 16 |
{ |
| 17 |
void f(int infoo) { } // { dg-bogus "shadows a parameter" } |
| 18 |
}; |
| 19 |
return outfoo; |
| 20 |
} |
| 21 |
|
| 22 |
// PR c++/39763 |
| 23 |
int foo2(void) |
| 24 |
{ |
| 25 |
int infoo = 0; // { dg-bogus "shadowed declaration" } |
| 26 |
int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" } |
| 27 |
struct A |
| 28 |
{ |
| 29 |
void f(int infoo) { } // { dg-bogus "shadows a previous local" } |
| 30 |
}; |
| 31 |
return outfoo; |
| 32 |
} |