================ @@ -10918,7 +11083,44 @@ bool OverloadCandidate::NotValidBecauseConstraintExprHasError() const { OverloadingResult OverloadCandidateSet::BestViableFunction(Sema &S, SourceLocation Loc, iterator &Best) { + + bool TwoPhaseResolution = + !NonDeducedCandidates.empty() && Kind != CSK_CodeCompletion && + Kind != CSK_InitByUserDefinedConversion && Kind != CSK_InitByConstructor; + + if (TwoPhaseResolution) { + Best = end(); + for (auto It = begin(); It != end(); ++It) { + if (It->isPerfectMatch(S.getASTContext())) { + if (Best == end()) { + Best = It; + } else { + Best = end(); + break; + } + } + } + if (Best != end()) { + Best->Best = true; + if (Best->Function && Best->Function->isDeleted()) + return OR_Deleted; + if (auto *M = dyn_cast_or_null<CXXMethodDecl>(Best->Function); + Kind == CSK_AddressOfOverloadSet && M && + M->isImplicitObjectMemberFunction()) { + return OR_No_Viable_Function; + } + return OR_Success; + } + } + InjectNonDeducedTemplateCandidates(S); + return BestViableFunctionImpl(S, Loc, Best); +} + +OverloadingResult OverloadCandidateSet::BestViableFunctionImpl( + Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best) { + ---------------- cor3ntin wrote:
This is the meat of the change (that and the definition of `isPerfectMatch`) https://github.com/llvm/llvm-project/pull/133426 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits