The following code generates a compiler error on the function definition. Tested with 3.4.1 release 3.4.3 release 4.0.0 release
--- template<class T> class foo { public: typedef T foo2; foo2 bar(); }; template<class T> foo<T>::foo2 foo<T>::bar() { return foo2(); } -- Summary: definition member function of template class with nested class as return type Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: wich at stack dot nl CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21575