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

Mital Ashok via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 3 06:19:03 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);
----------------
MitalAshok wrote:

This matches GCC behaviour: https://godbolt.org/z/6Eax3eqrd

But I'm not sure why it's defined in C++ at all

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


More information about the cfe-commits mailing list