Debian Codegraph @

gcc/testsuite/g++.dg/template/friend82.C

raw
1 // { dg-do compile }
2
3 template<class T>
4 struct A {
5 template<class U> struct B;
6
7 template<class U>
8 struct C {
9 template<class V> friend struct A::B;
10 private:
11 int x;
12 };
13 };
14
15 template <class T>
16 template <class U>
17 struct A<T>::B {
18 int foo(A<int*>::C<long> c) { return c.x; } // { dg-error "private" }
19 };
20
21 template struct A<int*>::C<long>;
22 template struct A<int*>::B<long>; // { dg-bogus "" }
23 template struct A<double*>::B<long>; // { dg-message "required from here" }