[PATCH] D152634: [Sema] Remove unused isNonTypeNestedNameSpecifier

Kazu Hirata via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 10 14:47:36 PDT 2023


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

The last use was removed by:

  commit 04f131da0b19abff611773c03be9bafb53c753ce
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   Fri Jan 24 15:14:25 2020 -0800


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152634

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaCXXScopeSpec.cpp


Index: clang/lib/Sema/SemaCXXScopeSpec.cpp
===================================================================
--- clang/lib/Sema/SemaCXXScopeSpec.cpp
+++ clang/lib/Sema/SemaCXXScopeSpec.cpp
@@ -415,51 +415,6 @@
   return nullptr;
 }
 
-bool Sema::isNonTypeNestedNameSpecifier(Scope *S, CXXScopeSpec &SS,
-                                        NestedNameSpecInfo &IdInfo) {
-  QualType ObjectType = GetTypeFromParser(IdInfo.ObjectType);
-  LookupResult Found(*this, IdInfo.Identifier, IdInfo.IdentifierLoc,
-                     LookupNestedNameSpecifierName);
-
-  // Determine where to perform name lookup
-  DeclContext *LookupCtx = nullptr;
-  bool isDependent = false;
-  if (!ObjectType.isNull()) {
-    // This nested-name-specifier occurs in a member access expression, e.g.,
-    // x->B::f, and we are looking into the type of the object.
-    assert(!SS.isSet() && "ObjectType and scope specifier cannot coexist");
-    LookupCtx = computeDeclContext(ObjectType);
-    isDependent = ObjectType->isDependentType();
-  } else if (SS.isSet()) {
-    // This nested-name-specifier occurs after another nested-name-specifier,
-    // so long into the context associated with the prior nested-name-specifier.
-    LookupCtx = computeDeclContext(SS, false);
-    isDependent = isDependentScopeSpecifier(SS);
-    Found.setContextRange(SS.getRange());
-  }
-
-  if (LookupCtx) {
-    // Perform "qualified" name lookup into the declaration context we
-    // computed, which is either the type of the base of a member access
-    // expression or the declaration context associated with a prior
-    // nested-name-specifier.
-
-    // The declaration context must be complete.
-    if (!LookupCtx->isDependentContext() &&
-        RequireCompleteDeclContext(SS, LookupCtx))
-      return false;
-
-    LookupQualifiedName(Found, LookupCtx);
-  } else if (isDependent) {
-    return false;
-  } else {
-    LookupName(Found, S);
-  }
-  Found.suppressDiagnostics();
-
-  return Found.getAsSingle<NamespaceDecl>();
-}
-
 namespace {
 
 // Callback to only accept typo corrections that can be a valid C++ member
Index: clang/include/clang/Sema/Sema.h
===================================================================
--- clang/include/clang/Sema/Sema.h
+++ clang/include/clang/Sema/Sema.h
@@ -6994,9 +6994,6 @@
     }
   };
 
-  bool isNonTypeNestedNameSpecifier(Scope *S, CXXScopeSpec &SS,
-                                    NestedNameSpecInfo &IdInfo);
-
   bool BuildCXXNestedNameSpecifier(Scope *S,
                                    NestedNameSpecInfo &IdInfo,
                                    bool EnteringContext,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152634.530255.patch
Type: text/x-patch
Size: 2632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230610/2387d9c9/attachment.bin>


More information about the cfe-commits mailing list