http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52373
Bug #: 52373 Summary: template usage drops some checks on the accessibility of a member Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: sylves...@debian.org Considering this code: ---- class A { struct st { static void f(); }; }; template <typename t> void foo() { A::st::f(); } --- g++ accepts it. If I remove "template <typename t>", an error is triggered (which is the expected behavior): plop.cpp: In function ‘void foo()’: plop.cpp:4:12: error: ‘struct A::st’ is private plop.cpp:12:5: error: within this context