Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/friend9.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 }; |