https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10200
--- Comment #30 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #28) > Another example: > > template<class Tp> inline void end(Tp) { } > > template <typename T> bool tnegative(const T& t) { return t.end < 0; } > > > pe.cc: In function ‘bool tnegative(const T&)’: > pe.cc:3:61: error: parse error in template argument list > template <typename T> bool tnegative(const T& t) { return t.end < 0; } > ^~~~~~~ /* ??? Can we actually assume that, if template_id == error_mark_node, we will have issued a diagnostic to the user, as opposed to simply marking the tentative parse as failed? */ if (cp_parser_error_occurred (parser) && template_id != error_mark_node) => error_at (token->location, "parse error in template argument list"); But actually the issue is that template_id != error_mark_node, but it is not a template id, so we are still tentatively parsing and this error is wrong.