OSDN Git Service

PR c++/56395
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / friend24.C
1 // { dg-do compile }
2
3 // Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
4
5 // PR c++/495: Fail to locate primary class template that is
6 // injected by friend declaration.
7
8 template <int N> struct X
9 {
10   template <int dim> friend struct Y;
11 };
12
13 X<2> x;
14
15 template <int dim> struct Y
16 {
17   void f (Y);
18   void g (Y);
19 };
20
21 template <int dim> void Y<dim>::f (Y)
22 {
23 }
24
25 template <int dim> void Y<dim>::g (Y<dim>)
26 {
27 }