3 // Copyright (C) 2004 Free Software Foundation
4 // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
6 // Nested class of class template as friend
8 template<class T> struct A
10 template <class U> struct B1
13 template <class U> struct B2
20 int i; // { dg-error "private" }
21 template<class T> template <class U> friend struct A<T>::B1;
24 template<class T> template <class U> void A<T>::B2<U>::f()
27 c.i = 0; // { dg-error "context" }
33 b1.f(); // { dg-message "required" }