summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/docs/UsersManual.rst2
-rw-r--r--clang/include/clang/Driver/CLCompatOptions.td6
-rw-r--r--clang/test/Driver/cl-options.c7
3 files changed, 15 insertions, 0 deletions
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index 88cb72c9b61..c9195e90827 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -3051,6 +3051,8 @@ Execute ``clang-cl /?`` to see a list of supported options:
/Yc<filename> Generate a pch file for all code up to and including <filename>
/Yu<filename> Load a pch file and use it instead of all code up to and including <filename>
/Z7 Enable CodeView debug information in object files
+ /Zc:char8_t Enable C++2a char8_t type
+ /Zc:char8_t- Disable C++2a char8_t type
/Zc:dllexportInlines- Don't dllexport/dllimport inline member functions of dllexport/import classes
/Zc:dllexportInlines dllexport/dllimport inline member functions of dllexport/import classes (default)
/Zc:sizedDealloc- Disable C++14 sized global deallocation functions
diff --git a/clang/include/clang/Driver/CLCompatOptions.td b/clang/include/clang/Driver/CLCompatOptions.td
index fb02d856a25..577a66786ad 100644
--- a/clang/include/clang/Driver/CLCompatOptions.td
+++ b/clang/include/clang/Driver/CLCompatOptions.td
@@ -212,6 +212,12 @@ def _SLASH_Zc_alignedNew : CLFlag<"Zc:alignedNew">,
def _SLASH_Zc_alignedNew_ : CLFlag<"Zc:alignedNew-">,
HelpText<"Disable C++17 aligned allocation functions">,
Alias<fno_aligned_allocation>;
+def _SLASH_Zc_char8_t : CLFlag<"Zc:char8_t">,
+ HelpText<"Enable char8_t from C++2a">,
+ Alias<fchar8__t>;
+def _SLASH_Zc_char8_t_ : CLFlag<"Zc:char8_t-">,
+ HelpText<"Disable char8_t from c++2a">,
+ Alias<fno_char8__t>;
def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">,
HelpText<"Treat string literals as const">, Alias<W_Joined>,
AliasArgs<["error=c++11-compat-deprecated-writable-strings"]>;
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index 0f64060d107..4b41720441a 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -326,6 +326,13 @@
// RUN: %clang_cl -c /Zc:twoPhase -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s
// DELAYEDOFF-NOT: "-fdelayed-template-parsing"
+// RUN: %clang_cl -c -### /std:c++latest -- %s 2>&1 | FileCheck -check-prefix CHECK-LATEST-CHAR8_T %s
+// CHECK-LATEST-CHAR8_T-NOT: "-fchar8_t"
+// RUN: %clang_cl -c -### /Zc:char8_t -- %s 2>&1 | FileCheck -check-prefix CHECK-CHAR8_T %s
+// CHECK-CHAR8_T: "-fchar8_t"
+// RUN: %clang_cl -c -### /Zc:char8_t- -- %s 2>&1 | FileCheck -check-prefix CHECK-CHAR8_T_ %s
+// CHECK-CHAR8_T_: "-fno-char8_t"
+
// For some warning ids, we can map from MSVC warning to Clang warning.
// RUN: %clang_cl -wd4005 -wd4100 -wd4910 -wd4996 -### -- %s 2>&1 | FileCheck -check-prefix=Wno %s
// Wno: "-cc1"
OpenPOWER on IntegriCloud