aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/friend9.C
blob: 4464e5f8ee8a816a3de24a47a374100807099d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do compile }
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>

// PR c++/8099
// Partial specialization as friend class

template <int N, typename T> struct X;
template <typename T>        struct X<1,T>;

template <typename P> class Y {
    static int i;
    template <int N, typename T> friend struct X;
    friend struct X<1,P>;
};

template <typename T> struct X<1,T> {
    X () { Y<T>::i; };     // access private field
};