summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/friend32.C
blob: 81e6390d798eaf0d1acb41d693f24fa03a5d1111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do compile }

// Origin: Steven Bosscher <steven@gcc.gnu.org>
//	   Serge Belyshev <belyshev@lubercy.com>

// PR c++/18825: ICE member as friend

template<class T> class A
{
  void f ();			// { dg-error "private" }
};

template<class T> class B
{
  friend void A<T>::f ();	// { dg-error "this context" }
};

int f ()
{
  B<int> b;			// { dg-message "instantiated" }
}