http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50418
Bug #: 50418 Summary: nested class typedef with same name and pointing to parent class typedef Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: frrr...@gmail.com struct A { typedef int T; struct B { typedef T T; }; }; test.cpp:6:19: error: declaration of ‘typedef A::T A::B::T’ test.cpp:3:17: error: changes meaning of ‘T’ from ‘typedef int A::T’ It works with Comeau, Clang and VC++, gcc workaround is the following: struct A { typedef int T; struct B { typedef A::T T; }; };