http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58129
Bug ID: 58129 Summary: [C++11] Lack of access control checking using auto type deduction Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: abikineev at termt dot com There is no access control via using auto keyword for nested classes: class A { class Private{}; public: static Private foo() { return Private(); } }; int main() { A::Private normal = A::foo(); // OK: compiler produces error; auto error = A::foo(); // ERROR: compiler doesn't see error; }