aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend8.C
blob: 886096b9d54a1c7d0e9375715a761cafb4fca89f (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
// { dg-do compile }

// Origin: Martin Sebor <sebor@roguewave.com>

// PR c++/5369: Member function of class template as friend

template <class T>
struct S
{
  int foo () {
    return S<int>::bar ();
  }

private:

  template <class U>
  friend int S<U>::foo ();

  static int bar () { return 0; }
};

int main ()
{
  S<char>().foo ();
}