================
@@ -422,7 +425,15 @@ std::vector<const NamedDecl *> 
HeuristicResolverImpl::resolveDependentMember(
     if (!RD->hasDefinition())
       return {};
     RD = RD->getDefinition();
-    return lookupDependentName(RD, Name, Filter);
+    return lookupDependentName(RD, Name, [&](const NamedDecl *ND) {
+      if (!Filter(ND))
+        return false;
+      if (const auto *MD = dyn_cast<CXXMethodDecl>(ND)) {
+        if (QT.isConstQualified() && !MD->isConst())
+          return false;
----------------
zyn0217 wrote:

We also have `isVolatileQualfied()/isRestrictQualified()`... do we also want to 
handle them?

With that in mind, I'm also thinking if we can reuse something from Sema e.g. 
we have 
[`hasInconsistentOrSupersetQualifiersOf()`](https://searchfox.org/llvm/source/clang/lib/Sema/SemaTemplateDeduction.cpp#1315-1340)
 that does the similar job in SemaTemplateDeduction.cpp that you might want to 
take a look.

https://github.com/llvm/llvm-project/pull/123551
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to