[PATCH] D127363: [Lex] Fix for char32_t literal truncation on 16 bit architectures

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 9 07:35:19 PDT 2022


sammccall added a comment.

In D127363#3570150 <https://reviews.llvm.org/D127363#3570150>, @aaron.ballman wrote:

>> On 16 bit architectures char32_t literals are truncated, for example U'\U00064321' will be truncated to 0x4321.
>
> Is that valid?
>
> https://eel.is/c++draft/basic.types#basic.fundamental-9.sentence-2 and also C2x 7.29p2 (which has the same underlying type requirement) both say that the underlying type for `char32_t` is `uint_least32_t`. Adding @tahonermann to verify.

I think Sebastian is describing the current broken behavior that this patch fixes.
So if you're saying "that sounds wrong" then I think we're all in agreement :-)

(Sorry if I'm misreading either Sebastian's comment or yours).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127363/new/

https://reviews.llvm.org/D127363



More information about the cfe-commits mailing list