summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wshadow-4.C
blob: c033028d727fa49bf2567cf9b9bd3d5fe2a3d2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// PR c++/39526
// { dg-options "-Wshadow" }

class INetURLObject
{
public:
    INetURLObject(int i);
    int GetMainURL() const;
};

int foo(int infoo)		// { dg-bogus "shadowed declaration" }
{
  int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
  extern void f(int infoo);
  struct A
  {
    void f(int infoo) { }	// { dg-bogus "shadows a parameter" }
  };
  return outfoo;
}

// PR c++/39763
int foo2(void)
{
    int infoo = 0;		// { dg-bogus "shadowed declaration" }
    int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
    struct A
    {
      void f(int infoo) { }	// { dg-bogus "shadows a previous local" }
    };
    return outfoo;
}