[PATCH] D119221: [clang][lexer] Allow u8 character literal prefixes in C2x

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 11 06:22:18 PST 2022

aaron.ballman added a reviewer: tahonermann.
aaron.ballman added a comment.

Can you also add a release note for the new feature, and update the `clang/www/c_status.html` page as well?

Comment at: clang/test/Lexer/utf8-char-literal.cpp:23
+char f = u8'ab';            // expected-error {{Unicode character literals may not contain multiple characters}}
+char g = u8'\x80';          // expected-warning {{implicit conversion from 'int' to 'char' changes value from 128 to -128}}
One more test I'd like to see added, just to make sure we're covering properly:
           default: 0,
           unsigned char : 1),
We expect the type of a u8 character literal to be `unsigned char` at the moment, which is different from a u8 string literal, which uses `char`.

However, WG14 is also going to be considering http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm for C2x at our meeting next week.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list