3 // Make sure we make the right unqualified class a friend
6 template <class T> struct A
12 template <class T> class B
15 friend struct B::AA; // OK, this has an implicit typename
16 // as if it is 'friend struct typename B::AA'
17 // (I think there's a defect report
19 friend struct AC; // this makes ::AC a friend *not* A<T>::AC
21 private: // only our friends can get out values
26 template <typename T> T B<T>::valueA_AA;
27 template <typename T> T B<T>::valueA_AC;// { dg-error "" "" } private -
28 template <typename T> T B<T>::value_AC; // { dg-bogus "" "" } -
30 // this one is a friend
31 template <class T> struct A<T>::AA
35 return B<T>::valueA_AA;
39 // this is not a friend
40 template <class T> struct A<T>::AC
44 return B<T>::valueA_AC; // { dg-error "" "" } within this context -
53 return B<int>::value_AC; // { dg-bogus "" "" } -