[clang] [Clang] [C23] Implement N2653: u8 strings are char8_t[] (PR #97208)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 15 11:58:54 PDT 2024


================
@@ -1165,6 +1165,8 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
   DefineType("__WCHAR_TYPE__", TI.getWCharType(), Builder);
   DefineType("__WINT_TYPE__", TI.getWIntType(), Builder);
   DefineTypeSizeAndWidth("__SIG_ATOMIC", TI.getSigAtomicType(), TI, Builder);
+  if (LangOpts.Char8 || LangOpts.C23)
+    DefineType("__CHAR8_TYPE__", TI.UnsignedChar, Builder);
----------------
AaronBallman wrote:

FWIW, I think https://github.com/llvm/llvm-project/issues/55373 should be fixed so that the option is rejected in C modes, but that's somewhat orthogonal to this patch.

https://github.com/llvm/llvm-project/pull/97208


More information about the cfe-commits mailing list