summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/friend21.C
blob: 762ea9bae7dacc0c2499bf2df2e74e2574771d7f (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
// { dg-do assemble  }

template <class T> struct A {
  static void f();
};

template <class T> class B
{
  friend class A<T>;
  static int i; // { dg-error "" } private
};

template <class T> class C
{
  template <class U>
  friend class A;

  static int i;
};

template <class T>
void A<T>::f()
{
  B<T>::i = 3;
  C<T>::i = 3;
  C<double>::i = 3;
  B<double>::i = 3; // { dg-error "" } member `i' is private
}

template void A<int>::f();