[clang] [Clang][WIP][RFC] Bypass TAD during overload resolution if a perfect match exists (PR #133426)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 28 04:52:04 PDT 2025


================
@@ -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;
----------------
zyn0217 wrote:

I must be missing something, are `CSK_InitByUserDefinedConversion` and `CSK_InitByConstructor` something special that we can't apply to them?

(explanations are appreciated!)

https://github.com/llvm/llvm-project/pull/133426


More information about the cfe-commits mailing list