summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C
blob: b43f21a7fa4409318d3e171e163199c67ef3c1a6 (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
// { dg-do run  }
//
// egcs-2.90.06
// cannot declare friend of enclosing class using its scope, works fine
// without scope or for definition of foo::bar::f
//

class foo
{
public:
  static int f();
  class bar {
    friend int foo::f();
//  friend int f();
    static int x;
  public:
    static int f() {return foo::f();}
   };
};

int foo::bar::x;

int foo::f() {
  return bar::x;
}

int
main ()
{
  return foo::bar::f ();
}