http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49129
Summary: confusing diagnostic for missing semi-colon after member template Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: diagnostic Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: r...@gcc.gnu.org CC: froy...@gcc.gnu.org typedef int I; struct X { template<class> struct Y { } // oops, missing ';' static I f(); }; expinit.cc:7:12: error: expected initializer before ‘f’ If f returns 'int' instead of a typedef then the error is good: expinit.cc:5:30: error: expected ‘;’ after struct definition If X::Y is not a template then the error is good: expinit.cc:7:10: error: expected ‘;’ at end of member declaration expinit.cc:7:14: error: ISO C++ forbids declaration of ‘f’ with no type [-fpermissive]