[clang] [clang] Diagnose default arguments defined in different scopes (PR #124844)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 01:35:53 PST 2025


================
@@ -10960,6 +10960,10 @@ OverloadCandidateSet::BestViableFunction(Sema &S, SourceLocation Loc,
     S.diagnoseEquivalentInternalLinkageDeclarations(Loc, Best->Function,
                                                     EquivalentCands);
 
+  // [over.match.best]/4 is checked for in Sema::ConvertArgumentsForCall,
+  // because not every function call goes through our overload resolution
+  // machinery, even if the Standard says it supposed to.
+
----------------
cor3ntin wrote:

ideally we would return `OR_Ambiguous` here, and then special case the diagnostic for that when all candidates are redeclarations

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


More information about the cfe-commits mailing list