mizvekov updated this revision to Diff 437906. mizvekov added a comment. rebase
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127690/new/ https://reviews.llvm.org/D127690 Files: clang/lib/Parse/Parser.cpp Index: clang/lib/Parse/Parser.cpp =================================================================== --- clang/lib/Parse/Parser.cpp +++ 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
Index: clang/lib/Parse/Parser.cpp =================================================================== --- clang/lib/Parse/Parser.cpp +++ 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
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits