[clang] [Clang][RFC] Bypass TAD during overload resolution if a perfect match exists (PR #133426)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 31 22:57:04 PDT 2025
================
@@ -14354,6 +14584,17 @@ ExprResult Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn,
OverloadingResult OverloadResult =
CandidateSet.BestViableFunction(*this, Fn->getBeginLoc(), Best);
+ // [C++23][over.call.func]
+ // if overload resolution selects a non-static member function,
+ // the call is ill-formed;
+ if (CSK == OverloadCandidateSet::CSK_AddressOfOverloadSet &&
+ Best != CandidateSet.end()) {
----------------
zyn0217 wrote:
Hmmm. I'm surprised this wasn't caught until now. Do you have a test case? (or is this something copied from elsewhere?)
https://github.com/llvm/llvm-project/pull/133426
More information about the cfe-commits
mailing list