[clang] 4c43d6a - [clang] Alias iso9899:2024 to C23, update documentation (#138459)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 04:36:22 PDT 2025


Author: Raul Tambre
Date: 2025-05-05T14:36:18+03:00
New Revision: 4c43d6ae984e13c3d5b01e3f7254bbf2956ffa1b

URL: https://github.com/llvm/llvm-project/commit/4c43d6ae984e13c3d5b01e3f7254bbf2956ffa1b
DIFF: https://github.com/llvm/llvm-project/commit/4c43d6ae984e13c3d5b01e3f7254bbf2956ffa1b.diff

LOG: [clang] Alias iso9899:2024 to C23, update documentation (#138459)

Added: 
    

Modified: 
    clang/docs/CommandGuide/clang.rst
    clang/docs/ReleaseNotes.rst
    clang/include/clang/Basic/LangStandards.def
    clang/test/Driver/unknown-std.c

Removed: 
    


################################################################################
diff  --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst
index 42aac7b25d93c..e3399d39bf00c 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -146,6 +146,15 @@ Language Selection and Mode Options
 
    ISO C 2017 with GNU extensions
 
+  | ``c23``
+  | ``iso9899:2024``
+
+   ISO C 2023
+
+  | ``gnu23``
+
+   ISO C 2023 with GNU extensions
+
  The default C language standard is ``gnu17``, except on PS4, where it is
  ``gnu99``.
 

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 599567560f733..a80fedebf8f89 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -241,6 +241,7 @@ C2y Feature Support
 
 C23 Feature Support
 ^^^^^^^^^^^^^^^^^^^
+- Clang now accepts ``-std=iso9899:2024`` as an alias for C23.
 - Added ``__builtin_c23_va_start()`` for compatibility with GCC and to enable
   better diagnostic behavior for the ``va_start()`` macro in C23 and later.
   This also updates the definition of ``va_start()`` in ``<stdarg.h>`` to use

diff  --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def
index 982a79873adb5..49cd9881829d4 100644
--- a/clang/include/clang/Basic/LangStandards.def
+++ b/clang/include/clang/Basic/LangStandards.def
@@ -89,15 +89,14 @@ LANGSTANDARD_ALIAS(gnu17, "gnu18")
 
 // C23 modes
 LANGSTANDARD(c23, "c23",
-             C, "Working Draft for ISO C23",
+             C, "ISO C 2023",
              LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat)
+LANGSTANDARD_ALIAS(c23, "iso9899:2024")
 LANGSTANDARD_ALIAS_DEPR(c23, "c2x")
 LANGSTANDARD(gnu23, "gnu23",
-             C, "Working Draft for ISO C23 with GNU extensions",
+             C, "ISO C 2023 with GNU extensions",
              LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat)
 LANGSTANDARD_ALIAS_DEPR(gnu23, "gnu2x")
-// FIXME: Add the alias for iso9899:202* once we know the year ISO publishes
-// the document (expected to be 2024).
 
 // C2y modes
 LANGSTANDARD(c2y, "c2y",

diff  --git a/clang/test/Driver/unknown-std.c b/clang/test/Driver/unknown-std.c
index 332d587ddd4a1..539b04f69b9ae 100644
--- a/clang/test/Driver/unknown-std.c
+++ b/clang/test/Driver/unknown-std.c
@@ -15,11 +15,10 @@
 // CHECK-NEXT: note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
 // CHECK-NEXT: note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard
 // CHECK-NEXT: note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard
-// CHECK-NEXT: note: use 'c23' for 'Working Draft for ISO C23' standard
-// CHECK-NEXT: note: use 'gnu23' for 'Working Draft for ISO C23 with GNU extensions' standard
+// CHECK-NEXT: note: use 'c23' or 'iso9899:2024' for 'ISO C 2023' standard
+// CHECK-NEXT: note: use 'gnu23' for 'ISO C 2023 with GNU extensions' standard
 // CHECK-NEXT: note: use 'c2y' for 'Working Draft for ISO C2y' standard
 // CHECK-NEXT: note: use 'gnu2y' for 'Working Draft for ISO C2y with GNU extensions' standard
 
 // Make sure that no other output is present.
 // CHECK-NOT: {{^.+$}}
-


        


More information about the cfe-commits mailing list