gcc/c-family/ChangeLog:

        * c-common.h (D_CXX11): Adjust.
        (D_EXT): Likewise.
        (D_EXT89): Likewise.
        (D_EXT11): Likewise.
        (D_ASM): Likewise.
        (D_OBJC): Likewise.
        (D_CXX_OBJC): Likewise.
        (D_CXXWARN): Likewise.
        (D_CXX_CONCEPTS): Likewise.
        (D_TRANSMEM): Likewise.
        (D_CXX_CHAR8_T): Likewise.
        (D_CXX20): Likewise.
        (D_CXX_COROUTINES): Likewise.
        (D_CXX_MODULES): Likewise.
        (D_C2Y): Introduce.

gcc/c/ChangeLog:

        * c-parser.cc (c_parse_init): Set new c2y mask.

Signed-off-by: Anna (navi) Figueiredo Gomes <n...@vlhl.dev>
---
 gcc/c-family/c-common.h | 29 +++++++++++++++--------------
 gcc/c/c-parser.cc       |  2 ++
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 7c7e21d2d0e..5c0fddd5221 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -434,20 +434,21 @@ extern machine_mode c_default_pointer_mode;
 #define D_CXXONLY      0x0002  /* C++ only (not in C).  */
 #define D_C99          0x0004  /* In C, C99 only.  */
 #define D_C23          0x0008  /* In C, C23 only.  */
-#define D_CXX11         0x0010 /* In C++, C++11 only.  */
-#define D_EXT          0x0020  /* GCC extension.  */
-#define D_EXT89                0x0040  /* GCC extension incorporated in C99.  
*/
-#define D_EXT11                0x0080  /* GCC extension incorporated in C23.  
*/
-#define D_ASM          0x0100  /* Disabled by -fno-asm.  */
-#define D_OBJC         0x0200  /* In Objective C and neither C nor C++.  */
-#define D_CXX_OBJC     0x0400  /* In Objective C, and C++, but not C.  */
-#define D_CXXWARN      0x0800  /* In C warn with -Wcxx-compat.  */
-#define D_CXX_CONCEPTS  0x1000 /* In C++, only with concepts.  */
-#define D_TRANSMEM     0x2000  /* C++ transactional memory TS.  */
-#define D_CXX_CHAR8_T  0x4000  /* In C++, only with -fchar8_t.  */
-#define D_CXX20                0x8000  /* In C++, C++20 only.  */
-#define D_CXX_COROUTINES 0x10000  /* In C++, only with coroutines.  */
-#define D_CXX_MODULES  0x20000  /* In C++, only with modules.  */
+#define D_C2Y          0x0010  /* In C, C2y only.  */
+#define D_CXX11         0x0020 /* In C++, C++11 only.  */
+#define D_EXT          0x0040  /* GCC extension.  */
+#define D_EXT89                0x0080  /* GCC extension incorporated in C99.  
*/
+#define D_EXT11                0x0100  /* GCC extension incorporated in C23.  
*/
+#define D_ASM          0x0200  /* Disabled by -fno-asm.  */
+#define D_OBJC         0x0400  /* In Objective C and neither C nor C++.  */
+#define D_CXX_OBJC     0x0800  /* In Objective C, and C++, but not C.  */
+#define D_CXXWARN      0x1000  /* In C warn with -Wcxx-compat.  */
+#define D_CXX_CONCEPTS  0x2000 /* In C++, only with concepts.  */
+#define D_TRANSMEM     0x4000  /* C++ transactional memory TS.  */
+#define D_CXX_CHAR8_T  0x8000  /* In C++, only with -fchar8_t.  */
+#define D_CXX20                0x10000  /* In C++, C++20 only.  */
+#define D_CXX_COROUTINES 0x20000  /* In C++, only with coroutines.  */
+#define D_CXX_MODULES  0x40000  /* In C++, only with modules.  */
 
 #define D_CXX_CONCEPTS_FLAGS D_CXXONLY | D_CXX_CONCEPTS
 #define D_CXX_CHAR8_T_FLAGS D_CXXONLY | D_CXX_CHAR8_T
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 4a13fc0d384..1907293bc68 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -127,6 +127,8 @@ c_parse_init (void)
     mask |= D_C99;
   if (!flag_isoc23)
     mask |= D_C23;
+  if (!flag_isoc2y)
+    mask |= D_C2Y;
   if (flag_no_asm)
     {
       mask |= D_ASM | D_EXT;
-- 
2.49.1

Reply via email to