summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.niklas/t135.C
blob: 566b0ca1ba3cf1d851d996ad9af2f75cf141112f (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
// { dg-do compile }
// GROUPS niklas pt friend
template <class T> class C1
{
public:
	void diddle_C2 ();
};

class C2
{
	int data_member; // { dg-error "" }
  friend class C1; // { dg-error "" }
};

class C2 C2_object;

template <class T> void C1<T>::diddle_C2 ()
{
  C2_object.data_member = 99; // { dg-error "" }
}

C1<int> C1_int_object;

void foobar ()
{
  C1_int_object.diddle_C2 ();
}