[libcxx-commits] [clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)
Fangrui Song via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 8 16:46:52 PDT 2024
================
@@ -7238,10 +7238,15 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.addOptInFlag(CmdArgs, options::OPT_frelaxed_template_template_args,
options::OPT_fno_relaxed_template_template_args);
- // -fsized-deallocation is off by default, as it is an ABI-breaking change for
- // most platforms.
- Args.addOptInFlag(CmdArgs, options::OPT_fsized_deallocation,
- options::OPT_fno_sized_deallocation);
+ // -fsized-deallocation is on by default in C++14 onwards and otherwise off
+ // by default.
+ if (Arg *A = Args.getLastArg(options::OPT_fsized_deallocation,
+ options::OPT_fno_sized_deallocation)) {
+ if (A->getOption().matches(options::OPT_fno_sized_deallocation))
+ CmdArgs.push_back("-fno-sized-deallocation");
----------------
MaskRay wrote:
We should not pass -fno-sized-deallocation to cc1, as -fno-sized-deallocation is not a cc1 option and will cause a failure.
https://github.com/llvm/llvm-project/pull/83774
More information about the libcxx-commits
mailing list