[clang] [clang][doc] Document C2y flags (PR #138521)

Raul Tambre via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 05:37:36 PDT 2025


https://github.com/tambry created https://github.com/llvm/llvm-project/pull/138521

As discussed at https://github.com/llvm/llvm-project/pull/138459#issuecomment-2850716184

>From cff2d2a856b3e36935969612a4e4338e9d4a2fe3 Mon Sep 17 00:00:00 2001
From: Raul Tambre <raul at tambre.ee>
Date: Mon, 5 May 2025 15:36:39 +0300
Subject: [PATCH] [clang][doc] Document C2y flags

---
 clang/docs/CommandGuide/clang.rst           | 8 ++++++++
 clang/include/clang/Basic/LangStandards.def | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst
index e3399d39bf00c..1b8776c5e9ad2 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -155,6 +155,14 @@ Language Selection and Mode Options
 
    ISO C 2023 with GNU extensions
 
+  | ``c2y``
+
+   ISO C 202y
+
+  | ``gnu2y``
+
+   ISO C 202y with GNU extensions
+
  The default C language standard is ``gnu17``, except on PS4, where it is
  ``gnu99``.
 
diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def
index 49cd9881829d4..244692ab4296a 100644
--- a/clang/include/clang/Basic/LangStandards.def
+++ b/clang/include/clang/Basic/LangStandards.def
@@ -105,7 +105,7 @@ LANGSTANDARD(c2y, "c2y",
 LANGSTANDARD(gnu2y, "gnu2y",
              C, "Working Draft for ISO C2y with GNU extensions",
              LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | GNUMode | HexFloat)
-
+// TODO: Add the iso9899:202y alias once ISO publishes the standard.
 
 // C++ modes
 LANGSTANDARD(cxx98, "c++98",



More information about the cfe-commits mailing list