summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/friend5.C
blob: 5be37bbd5abc2dbe549a21a72be6ae1ac3846e63 (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
33
34
// { dg-do compile }

// Origin: aroach@stoic.electriceyeball.com

// PR c++/3332: Friend function lookup in class defined outside its
// namespace

namespace N
{
  class A;
}

class N::A
{
  void x();
  friend void func(void);
};

namespace N
{
  void func(void);
}

void N::func(void)
{
  N::A a;
  a.x();
}

int main()
{
  return 0;
}