template <typename> class X {}; class Y { typedef X<int> X; };
produces the following error: redef.cpp:4: error: declaration of 'typedef class X<int> Y::X' redef.cpp:1: error: changes meaning of 'X' from 'class X<int>' I don't think, that the error is correct, because as the typedef is inside a class-definition, X is only shadowed, not redeclared. The typedef'd type can be referred as Y::X, while the globel would be ::X. -- Summary: local typedef conflicts with global definition of a type having the same name Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rbuergel at web dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34531