From 28ddb91decff9bb9e28cf12e04b2b6bf78cadc3b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 14 Nov 2018 21:04:34 +0000 Subject: [c++20] Implement P0482R6: enable -fchar8_t by default in C++20 mode. This unfortunately results in a substantial breaking change when switching to C++20, but it's not yet clear what / how much we should do about that. We may want to add a compatibility conversion from u8 string literals to const char*, similar to how C++98 provided a compatibility conversion from string literals to non-const char*, but that's not handled by this patch. The feature can be disabled in C++20 mode with -fno-char8_t. llvm-svn: 346892 --- clang/lib/Sema/SemaInit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaInit.cpp') diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 438e90414d6..5249986ac03 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -8268,7 +8268,8 @@ bool InitializationSequence::Diagnose(Sema &S, break; case FK_UTF8StringIntoPlainChar: S.Diag(Kind.getLocation(), - diag::err_array_init_utf8_string_into_char); + diag::err_array_init_utf8_string_into_char) + << S.getLangOpts().CPlusPlus2a; break; case FK_ArrayTypeMismatch: case FK_NonConstantArrayInit: -- cgit v1.2.3