summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/friend19.C
blob: 73883b2a05afdbfe5941e1bff28d0738129cc129 (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
// { dg-do compile }

// Origin: Benjamin Li <benxbli@yahoo.com>

// PR c++/11030: Template substitution of friend class that is
// a specialization.

template <int S>
struct A
{
  void func(void);
};

template <class T>
class C
{
  static void private_func(void) {}
public:
  friend class A<512>;
};

template <int S>
void A<S>::func(void)
{
  C<void>::private_func();
}

template class A<512>;