5 Commits

Author SHA1 Message Date
Aaron Ballman
13629b1408 [C2x] Support -std=c23 and -std=gnu23
C2x was finalized at the June 2023 WG14 meeting. The DIS is out for
balloting and the comment period for that closes later this year/early
next year. While that does leave an opportunity for more changes to the
standard during the DIS ballot resolution process, only editorial
changes are anticipated and as a result, the C committee considers C2x
to be final. The committee took a straw poll on what we'd prefer the
informal name of the standard be, and we decided it should be called
C23 regardless of what year ISO publishes it.

However, because the final publication is not out, this patch does not
add the language standard alias for the -std=iso9899:<year> spelling of
the standard mode; that will be added once ISO finally publishes the
document and the year chosen will match the publication date.

This also changes the value of __STDC_VERSION__ from the placeholder
value 202000L to the final value 202311L.

Subsequent patches will start renaming things from c2x to c23, cleaning
up documentation, etc.

Differential Revision: https://reviews.llvm.org/D157606
2023-08-10 13:57:40 -04:00
Corentin Jabot
304e974694 [Clang] Correctly handle $, @, and ` when represented as UCN
This covers
 * P2558R2 (C++, wg21.link/P2558)
 * N2701 (C, https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2701.htm)
 * N3124 (C, https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3124.pdf)

This patch
 * Disallow representing $ as a UCN in all language mode, which did not
   properly work (see GH62133), and which in made ill-formed in
   C++ and C by P2558 and N3124 respectively
 * Allow a UCN for any character in C2X, in string and character
   literals

Fixes #62133

Reviewed By: #clang-language-wg, tahonermann

Differential Revision: https://reviews.llvm.org/D153621
2023-07-12 08:03:23 +02:00
Corentin Jabot
4e80636db7 Implement P1949
This adds the Unicode 13 data for XID_Start and XID_Continue.
The definition of valid identifier is changed in all C++ modes
as P1949 (https://wg21.link/p1949) was accepted by WG21 as a defect
report.
2021-08-18 07:33:14 -04:00
Joey Gouly
18730ba4ab Fix the range for Malayam UCNs in C99.
llvm-svn: 200845
2014-02-05 15:32:23 +00:00
Jordan Rose
58c61e006f Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11).
Add warnings under -Wc++11-compat, -Wc++98-compat, and -Wc99-compat when a
particular UCN is incompatible with a different standard, and -Wunicode when
a UCN refers to a surrogate character in C++03.

llvm-svn: 174788
2013-02-09 01:10:25 +00:00