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

Sebastian Perta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 9 10:42:02 PDT 2022


SebastianPerta added a comment.

>> Regarding testing, it seems like this should change the diagnostic emitted for long x = 'abc' from "Character constant too long for its type" to "Multi-character character constant" when the target is AVR?

Currently on RL78 it returns this warning without any extra changes:

  warning: multi-character character constant [-Wmultichar]
  long x = 'abc';
           ^

@sammccall  this is what you expect, correct?
I haven't built LLVM for AVR yet, I will do it and get back to you.

>> I think this should have a test, and we can probably use _Static_assert for it: https://godbolt.org/z/611bx47qc

Thank you for the help @aaron.ballman , I will update the patch with a test case using _Static_assert.


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