1// Copyright (C) 2003 Free Software Foundation 2// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 3// { dg-do compile } 4 5// Access checking during explicit instantiation. 6 7class A { 8 typedef int X; // { dg-error "private" } 9}; 10 11class X { 12 private: 13 template <typename T> struct Y; 14}; 15 16template <> struct X::Y<int> { 17 A::X x; // { dg-error "this context" } 18}; 19 20template <typename T> struct X::Y { 21 typename T::X x; // { dg-error "this context" } 22}; 23 24template struct X::Y<A>; // { dg-message "required from here" } 25