https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60916
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-10-05 CC| |manu at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- The error within notes is also quite confusing, it is not clear if the additional errors are explaining the notes or are separate errors. Clang makes this much clearer: test.cc:19:10: error: no matching function for call to 'wrapper' return wrapper<char, f> (); ^~~~~~~~~~~~~~~~ test.cc:6:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'F' int wrapper () ^ test.cc:12:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T2' int wrapper () ^ GCC at least could do: t.cc: In function ‘int docall()’: t.cc:19:28: error: no matching function for call to ‘wrapper()’ return wrapper<char, f> (); ^ t.cc:19:28: note: candidates are: t.cc:6:5: note: #1 'template<class T, int (* F)(const T*)> int wrapper()' int wrapper () ^ t.cc:6:5: note: template argument deduction/substitution failed: could not convert template argument ‘f’ to ‘int (*)(const char*)’ t.cc:12:5: note: #2 'template<class T1, class T2, int (* F)(const T1*, const T2*)> int wrapper()' int wrapper () ^ t.cc:12:5: note: template argument deduction/substitution failed: