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

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 08:12:42 PDT 2022


thakis added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6649
+  } else if (IsCPP17Onwards) {
+    CmdArgs.push_back("-faligned-allocation");
   }
----------------
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 (?)


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