[clang] [clang] Simplify the overload resolution logic for operator new and new[] (PR #211482)

Igor Kudrin via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 18:31:29 PDT 2026


================
@@ -2915,9 +2917,9 @@ DiagnoseAllocationLookupFailure(Sema &SemaRef, const LookupResult &BaseLookup,
   auto Rerun = [&](ImplicitAllocationArguments &ArgumentList,
                    OverloadCandidateSet &Candidates,
                    SmallVectorImpl<Expr *> &Args) {
+    std::optional<LookupResult> MSVCFallback;
     const LookupResult &LocalLookup =
-        ArgumentList.updateLookupForMSVCCompatibility(SemaRef, BaseLookup,
-                                                      MSVCFallback);
+        ArgumentList.updateLookupForMSVCCompatibility(SemaRef, R, MSVCFallback);
----------------
igorkudrin wrote:

There is no need to call `updateLookupForMSVCCompatibility()` here because `AlignedArgumentList` and `UnalignedArgumentList` cannot have the flags set, thanks to the filter in the loop.

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


More information about the cfe-commits mailing list