diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -2056,36 +2056,6 @@ return false; } - // If this is a template-id, annotate with a template-id or type token. - // FIXME: This appears to be dead code. We already have formed template-id - // tokens when parsing the scope specifier; this can never form a new one. - if (NextToken().is(tok::less)) { - TemplateTy Template; - UnqualifiedId TemplateName; - TemplateName.setIdentifier(Tok.getIdentifierInfo(), Tok.getLocation()); - bool MemberOfUnknownSpecialization; - if (TemplateNameKind TNK = Actions.isTemplateName( - getCurScope(), SS, - /*hasTemplateKeyword=*/false, TemplateName, - /*ObjectType=*/nullptr, /*EnteringContext*/false, Template, - MemberOfUnknownSpecialization)) { - // Only annotate an undeclared template name as a template-id if the - // following tokens have the form of a template argument list. - if (TNK != TNK_Undeclared_template || - isTemplateArgumentList(1) != TPResult::False) { - // Consume the identifier. - ConsumeToken(); - if (AnnotateTemplateIdToken(Template, TNK, SS, SourceLocation(), - TemplateName)) { - // If an unrecoverable error occurred, we need to return true here, - // because the token stream is in a damaged state. We may not - // return a valid identifier. - return true; - } - } - } - } - // The current token, which is either an identifier or a // template-id, is not part of the annotation. Fall through to // push that token back into the stream and complete the C++ scope