Skip to content

Commit 4c43d6a

Browse files
authored
[clang] Alias iso9899:2024 to C23, update documentation (#138459)
1 parent 112291a commit 4c43d6a

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

clang/docs/CommandGuide/clang.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ Language Selection and Mode Options
146146
147147
ISO C 2017 with GNU extensions
148148

149+
| ``c23``
150+
| ``iso9899:2024``
151+
152+
ISO C 2023
153+
154+
| ``gnu23``
155+
156+
ISO C 2023 with GNU extensions
157+
149158
The default C language standard is ``gnu17``, except on PS4, where it is
150159
``gnu99``.
151160

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ C2y Feature Support
241241

242242
C23 Feature Support
243243
^^^^^^^^^^^^^^^^^^^
244+
- Clang now accepts ``-std=iso9899:2024`` as an alias for C23.
244245
- Added ``__builtin_c23_va_start()`` for compatibility with GCC and to enable
245246
better diagnostic behavior for the ``va_start()`` macro in C23 and later.
246247
This also updates the definition of ``va_start()`` in ``<stdarg.h>`` to use

clang/include/clang/Basic/LangStandards.def

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,14 @@ LANGSTANDARD_ALIAS(gnu17, "gnu18")
8989

9090
// C23 modes
9191
LANGSTANDARD(c23, "c23",
92-
C, "Working Draft for ISO C23",
92+
C, "ISO C 2023",
9393
LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat)
94+
LANGSTANDARD_ALIAS(c23, "iso9899:2024")
9495
LANGSTANDARD_ALIAS_DEPR(c23, "c2x")
9596
LANGSTANDARD(gnu23, "gnu23",
96-
C, "Working Draft for ISO C23 with GNU extensions",
97+
C, "ISO C 2023 with GNU extensions",
9798
LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat)
9899
LANGSTANDARD_ALIAS_DEPR(gnu23, "gnu2x")
99-
// FIXME: Add the alias for iso9899:202* once we know the year ISO publishes
100-
// the document (expected to be 2024).
101100

102101
// C2y modes
103102
LANGSTANDARD(c2y, "c2y",

clang/test/Driver/unknown-std.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
// CHECK-NEXT: note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
1616
// CHECK-NEXT: note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard
1717
// CHECK-NEXT: note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard
18-
// CHECK-NEXT: note: use 'c23' for 'Working Draft for ISO C23' standard
19-
// CHECK-NEXT: note: use 'gnu23' for 'Working Draft for ISO C23 with GNU extensions' standard
18+
// CHECK-NEXT: note: use 'c23' or 'iso9899:2024' for 'ISO C 2023' standard
19+
// CHECK-NEXT: note: use 'gnu23' for 'ISO C 2023 with GNU extensions' standard
2020
// CHECK-NEXT: note: use 'c2y' for 'Working Draft for ISO C2y' standard
2121
// CHECK-NEXT: note: use 'gnu2y' for 'Working Draft for ISO C2y with GNU extensions' standard
2222

2323
// Make sure that no other output is present.
2424
// CHECK-NOT: {{^.+$}}
25-

0 commit comments

Comments
 (0)