diff --git a/clang/include/clang/Driver/CLCompatOptions.td b/clang/include/clang/Driver/CLCompatOptions.td index b09ea41049d1..3e0dc2db7d07 100644 --- a/clang/include/clang/Driver/CLCompatOptions.td +++ b/clang/include/clang/Driver/CLCompatOptions.td @@ -207,6 +207,12 @@ def _SLASH_Zc_sizedDealloc : CLFlag<"Zc:sizedDealloc">, def _SLASH_Zc_sizedDealloc_ : CLFlag<"Zc:sizedDealloc-">, HelpText<"Disable C++14 sized global deallocation functions">, Alias; +def _SLASH_Zc_alignedNew : CLFlag<"Zc:alignedNew">, + HelpText<"Enable C++17 aligned allocation functions">, + Alias; +def _SLASH_Zc_alignedNew_ : CLFlag<"Zc:alignedNew-">, + HelpText<"Disable C++17 aligned allocation functions">, + Alias; def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">, HelpText<"Treat string literals as const">, Alias, AliasArgs<["error=c++11-compat-deprecated-writable-strings"]>; diff --git a/clang/test/Driver/cl-zc.cpp b/clang/test/Driver/cl-zc.cpp index 4414eb6ebba2..cf7734875e1f 100644 --- a/clang/test/Driver/cl-zc.cpp +++ b/clang/test/Driver/cl-zc.cpp @@ -18,6 +18,12 @@ // RUN: %clang_cl /c -### /Zc:sizedDealloc- -- %s 2>&1 | FileCheck -check-prefix=SIZED-DEALLOC-OFF %s // SIZED-DEALLOC-OFF-NOT: "-fsized-deallocation" +// RUN: %clang_cl /c /std:c++17 -### /Zc:alignedNew -- %s 2>&1 | FileCheck -check-prefix=ALIGNED-NEW-ON %s +// ALIGNED-NEW-ON: "-faligned-allocation" + +// RUN: %clang_cl /c /std:c++17 -### /Zc:alignedNew- -- %s 2>&1 | FileCheck -check-prefix=ALIGNED-NEW-OFF %s +// ALIGNED-NEW-OFF-NOT: "-faligned-allocation" + // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-DEFAULT %s // STRICTSTRINGS-DEFAULT-NOT: -Werror=c++11-compat-deprecated-writable-strings // RUN: %clang_cl /c -### /Zc:strictStrings -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-ON %s