[PATCH] D124996: [clang][preprocessor] Fix unsigned-ness of utf8 char literals

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 05:55:17 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/test/Lexer/utf8-char-literal.cpp:3-4
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c2x -x c -fsyntax-only -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++1z -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c2x -x c -fsyntax-only -fchar8_t -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c2x -x c -fsyntax-only -fno-char8_t -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -fsyntax-only -verify %s
----------------
tahonermann wrote:
> Does the `-fchar8_t` option have any effect in C at present?
> 
> Gcc maintainers are currently not planning to acknowledge that option in C modes since WG14 did not want to add language dialect concerns for C. This is why [[https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm|N2653]] doesn't have wording that includes a feature test macro. The gcc maintainers pushed back on the `_CHAR8_T_SOURCE` macro mentioned in the "Implementation Experience" section.
> 
> I think Clang should follow suit; attempts to use `-fchar8_t` or `-fno-char8_t` in C modes should be diagnosed; which means that we don't have to exercise these options with C2x.
> Does the -fchar8_t option have any effect in C at present?

Yes, it does: https://godbolt.org/z/1co3YYYf8  (it sets `LangOpts.Char8`)


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

https://reviews.llvm.org/D124996



More information about the cfe-commits mailing list