This test program: struct bar;
template <class T> struct bar *foo (T *p) { return p->t; } produces an error in 4.0.0: test.cc:3: error: 'bar' is not a template type Without the keyword "struct" it compiles fine. Earlier versions (3.3.2, and I'm pretty sure 3.4.1 as well) don't complain. I've seen this on a native Linux build, and also a crosscompiler targeted at netbsd-mips and hosted on i386-mips. -- Summary: Template function definition rejected if function return type begins with 'struct' Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pkoning at equallogic dot com 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=21369