// Contributed by Dodji Seketeli // Origin PR c++/40007 // { dg-do compile } template struct x { protected: typedef int type; }; template struct y : public x { typename x::type z; }; template<> struct y : public x { typedef x::type z; }; template class y;