summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/friend11.C
blob: 04dbf2569882645bc09595731c1f7528337cb83e (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
// { dg-do assemble  }
template <class T>
class C;

template <class T>
struct S
{
  template <class U>
  void f(U u)
    {
      C<U> cu;
      cu.i = 3; // { dg-error "" } S<double>::f<U> is a friend, but this is
                //         S<int>::f<double>. 
    }
};


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

  int i; // { dg-error "" } private
};


int main()
{
  S<int> si;
  si.f(3.0);
}