summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/friend13.C
blob: 0bdd477a181edd1215149babd8bb63d9daeeba47 (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 run  }
template <class T>
class C;

template <class U>
struct S
{
  template <class V>
  void f(V v)
    {
      C<V> cv;
      cv.i = 3;
    }
};


template <class T>
class C
{
  template <class U>
  template <class V>
  friend void S<U>::f(V);

  int i;
};


int main()
{
  S<int> si;
  si.f(3.0);
  S<long> sl;
  sl.f('c');
}