[PATCH] D127641: [clang-cl][MSVC] Enable /Zc:alignedNew for C++17 and /Zc:sizedDealloc by default

Stephen Long via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 10:34:38 PDT 2022


steplong added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6649
+  } else if (IsCPP17Onwards) {
+    CmdArgs.push_back("-faligned-allocation");
   }
----------------
thakis wrote:
> Do we want to do this in the driver? From what I understand, we already do this (MSVC or not) at the Driver->Frontend boundary. See Options.td:
> 
> ```
> defm aligned_allocation : BoolFOption<"aligned-allocation",
>   LangOpts<"AlignedAllocation">, Default<cpp17.KeyPath>,
>   PosFlag<SetTrue, [], "Enable C++17 aligned allocation functions">,
>   NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
> ```
> 
> It defaults to on when c++17 is set, and makes its way to `LangOpts.AlignedAllocation`.
> 
> Does this change here have any effect? From looking at the code, this should be the current behavior already (?)
Hmmm, my test regarding checking for `-faligned-allocation` fails if I remove the code here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127641/new/

https://reviews.llvm.org/D127641



More information about the cfe-commits mailing list