OSDN Git Service

PR c++/9335
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / friend9.C
1 // { dg-do compile }
2 // Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
3
4 // PR c++/8099
5 // Partial specialization as friend class
6
7 template <int N, typename T> struct X;
8 template <typename T>        struct X<1,T>;
9
10 template <typename P> class Y {
11     static int i;
12     template <int N, typename T> friend struct X;
13     friend struct X<1,P>;
14 };
15
16 template <typename T> struct X<1,T> {
17     X () { Y<T>::i; }     // access private field
18 };