[PATCH] D106577: [clang] Define __STDC_ISO_10646__
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 22 11:16:34 PDT 2021
aaron.ballman added reviewers: aaron.ballman, rsmith, jyknight.
aaron.ballman added a comment.
Can you also add a test that explicitly uses `-fshort-wchar` to verify that we don't predefine the macro?
================
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:430-435
+ // Because Clang only supports UTF-32 or UTF-16 as the
+ // wide execution encoding, any platform that doesn't uses
+ // short wchar can represent the entire Unicode code space
+ // Unicode 13 was released in December 2020.
+ // Note that new Unicode version are *very* unlikely to affect
+ // representability
----------------
Are we going to have to remember to update this value each time Unicode updates?
================
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:436-438
+ if (TI.getWCharWidth() >= 32) {
+ Builder.defineMacro("__STDC_ISO_10646__", "202012L");
+ }
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106577/new/
https://reviews.llvm.org/D106577
More information about the cfe-commits
mailing list