@@ -44,6 +44,9 @@ class HeuristicResolverImpl {
4444 const DependentTemplateSpecializationType *DTST);
4545 QualType resolveNestedNameSpecifierToType (const NestedNameSpecifier *NNS);
4646 QualType getPointeeType (QualType T);
47+ std::vector<const NamedDecl *>
48+ lookupDependentName (CXXRecordDecl *RD, DeclarationName Name,
49+ llvm::function_ref<bool (const NamedDecl *ND)> Filter);
4750
4851private:
4952 ASTContext &Ctx;
@@ -83,16 +86,6 @@ class HeuristicResolverImpl {
8386 // during simplification, and the operation fails if no pointer type is found.
8487 QualType simplifyType (QualType Type, const Expr *E, bool UnwrapPointer);
8588
86- // This is a reimplementation of CXXRecordDecl::lookupDependentName()
87- // so that the implementation can call into other HeuristicResolver helpers.
88- // FIXME: Once HeuristicResolver is upstreamed to the clang libraries
89- // (https://github.com/clangd/clangd/discussions/1662),
90- // CXXRecordDecl::lookupDepenedentName() can be removed, and its call sites
91- // can be modified to benefit from the more comprehensive heuristics offered
92- // by HeuristicResolver instead.
93- std::vector<const NamedDecl *>
94- lookupDependentName (CXXRecordDecl *RD, DeclarationName Name,
95- llvm::function_ref<bool (const NamedDecl *ND)> Filter);
9689 bool findOrdinaryMemberInDependentClasses (const CXXBaseSpecifier *Specifier,
9790 CXXBasePath &Path,
9891 DeclarationName Name);
@@ -539,6 +532,11 @@ QualType HeuristicResolver::resolveNestedNameSpecifierToType(
539532 const NestedNameSpecifier *NNS) const {
540533 return HeuristicResolverImpl (Ctx).resolveNestedNameSpecifierToType (NNS);
541534}
535+ std::vector<const NamedDecl *> HeuristicResolver::lookupDependentName (
536+ CXXRecordDecl *RD, DeclarationName Name,
537+ llvm::function_ref<bool (const NamedDecl *ND)> Filter) {
538+ return HeuristicResolverImpl (Ctx).lookupDependentName (RD, Name, Filter);
539+ }
542540const QualType HeuristicResolver::getPointeeType (QualType T) const {
543541 return HeuristicResolverImpl (Ctx).getPointeeType (T);
544542}
0 commit comments