[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 1 06:16:29 PDT 2024
================
@@ -1342,8 +1342,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
getLockFreeValue(TI.get##Type##Width(), TI));
DEFINE_LOCK_FREE_MACRO(BOOL, Bool);
DEFINE_LOCK_FREE_MACRO(CHAR, Char);
- if (LangOpts.Char8)
- DEFINE_LOCK_FREE_MACRO(CHAR8_T, Char); // Treat char8_t like char.
+ // char8_t has the same representation / width as unsigned
+ // char in C++ and is a typedef for unsigned char in C23
+ if (LangOpts.Char8 || LangOpts.C23)
----------------
AaronBallman wrote:
Would it make more sense for `Char8` to be set by default based on `C23`?
https://github.com/llvm/llvm-project/pull/97208
More information about the cfe-commits
mailing list