[PATCH] D127690: [NFC] clang/Parser: remove dead code

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 20:00:09 PDT 2022


mizvekov updated this revision to Diff 439246.
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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127690.439246.patch
Type: text/x-patch
Size: 1877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220623/a583079d/attachment.bin>


More information about the cfe-commits mailing list