https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77477
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |error-recovery Last reconfirmed| |2016-09-04 Component|libstdc++ |c++ CC| |manu at gcc dot gnu.org Ever confirmed|0 |1 Summary|template functions don't |error recovery for explicit |seem to work |qualification Severity|normal |enhancement --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- The error is in your code, but g++ could be clearer: namespace str { template< class S > int find1(S searchIn, S searchFor, bool iCase=false, int pos=0); template< class S > int find2<S>(S searchIn, S searchFor, bool iCase=false, int pos=0); template< class S > int str::find3(S searchIn, S searchFor, bool iCase=false, int pos=0); template< class S > int str::find4<S>(S searchIn, S searchFor, bool iCase=false, int pos=0); } prog.cc:5:10: error: expected initializer before '<' token int find2<S>(S searchIn, S searchFor, bool iCase=false, int pos=0); ^ prog.cc:7:68: error: explicit qualification in declaration of 'int str::find3(S, S, bool, int)' int str::find3(S searchIn, S searchFor, bool iCase=false, int pos=0); ^ prog.cc:9:15: error: expected initializer before '<' token int str::find4<S>(S searchIn, S searchFor, bool iCase=false, int pos=0); ^