================
@@ -7636,7 +7651,16 @@ Sema::AddMethodCandidate(CXXMethodDecl *Method, 
DeclAccessPair FoundDecl,
       // exist for each argument an implicit conversion sequence
       // (13.3.3.1) that converts that argument to the corresponding
       // parameter of F.
-      QualType ParamType = Proto->getParamType(ArgIdx + ExplicitOffset);
+      QualType ParamType;
+      if (CandidateSet.getKind() ==
+              OverloadCandidateSet::CSK_AddressOfOverloadSet &&
+          Method->isImplicitObjectMemberFunction()) {
----------------
Sirraide wrote:

>From what I can tell, this function checks this exact condition in several 
>places, so we could maybe put sth. like this at the start of the function
```c++
bool AddImplicitObjectParam = 
    CandidateSet.getKind() == OverloadCandidateSet::CSK_AddressOfOverloadSet &&
    Method->isImplicitObjectMemberFunction()
```
and use that instead to make it a bit clearer that it’s really the same 
condition.

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

Reply via email to