[clang] [Clang][Sema][NFCI] Simplify `resolveAllocationOverload()` (PR #203824)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 00:17:06 PDT 2026


================
@@ -2889,6 +2789,68 @@ static bool resolveAllocationOverloadInterior(
   llvm_unreachable("Unreachable, bad result from BestViableFunction");
 }
 
+static void diagnoseNoViableFunctionForAllocationOverloadResolution(
+    Sema &S, LookupResult &R, SourceRange Range, ArrayRef<Expr *> PrefArgs,
+    ArrayRef<Expr *> FallbackArgs, OverloadCandidateSet &PrefCandidates,
+    OverloadCandidateSet *FallbackCandidates) {
+  // If this is an allocation of the form 'new (p) X' for some object
+  // pointer p (or an expression that will decay to such a pointer),
+  // diagnose the reason for the error.
----------------
ojhunt wrote:

I think it might be worth pulling this bit of the change out before anything else - it's essentially a non-functional change, but it creates a lot of complexity/noise in the diff.

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


More information about the cfe-commits mailing list