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

Igor Kudrin via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 22:05:14 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.
----------------
igorkudrin wrote:

#206219, PTAL. Note that the extracted function still mutates the argument list internally, so it'll need to be updated anyway.


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


More information about the cfe-commits mailing list