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

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 13:32:14 PDT 2022


mizvekov created this revision.
Herald added a project: All.
mizvekov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>


Repository:
  rG LLVM Github Monorepo

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
@@ -2044,36 +2044,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.436544.patch
Type: text/x-patch
Size: 1877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220613/eb2af638/attachment.bin>


More information about the cfe-commits mailing list