http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47346
Summary: access control for nested type is ignored in class template Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: r...@gcc.gnu.org There are several bugs about failure to do access checking for template parameters and in function templates (PR 40901, PR 41437, PR 45011, PR 45917) but I don't think this is a dup of any of them class C { struct Private { }; }; template<typename T> struct exploit1 { typedef C::Private type; }; exploit1<int>::type x1; // error // similarly for base-specifier template<typename T> struct exploit2 : C::Private { }; exploit2<int> x2; // error