Once they are accepted by the C Committee, this patch can be reverted.
gcc/c/ChangeLog:
* c-parser.cc (c_parser_maxof_or_minof_expression): Use
pedwarn() instead of pedwarn_c23().
gcc/testsuite/ChangeLog:
* gcc.dg/maxof-compat.c: Update test.
* gcc.dg/maxof-compile.c: Update test.
* gcc.dg/maxof-no-compat.c: Update test.
Signed-off-by: Alejandro Colomar <[email protected]>
---
gcc/c/c-parser.cc | 3 +--
gcc/testsuite/gcc.dg/maxof-compat.c | 4 ++--
gcc/testsuite/gcc.dg/maxof-compile.c | 2 +-
gcc/testsuite/gcc.dg/maxof-no-compat.c | 4 ++--
4 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 6319b46e129d..44f2b7f449a4 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -10939,8 +10939,7 @@ c_parser_maxof_or_minof_expression (c_parser *parser,
enum rid rid)
start = c_parser_peek_token (parser)->location;
- pedwarn_c23 (start, OPT_Wpedantic,
- "ISO C does not support %qs before C2Y", op_name);
+ pedwarn (start, OPT_Wpedantic, "ISO C does not support %qs", op_name);
c_parser_consume_token (parser);
c_inhibit_evaluation_warnings++;
diff --git a/gcc/testsuite/gcc.dg/maxof-compat.c
b/gcc/testsuite/gcc.dg/maxof-compat.c
index 2c023a3eaf7a..956d86e46bab 100644
--- a/gcc/testsuite/gcc.dg/maxof-compat.c
+++ b/gcc/testsuite/gcc.dg/maxof-compat.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-std=c2y -pedantic-errors -Wc23-c2y-compat" } */
-int a[_Maxof(char)]; /* { dg-warning "ISO C does not support" } */
-int b[1 + _Minof(unsigned char)]; /* { dg-warning "ISO C does not support" }
*/
+int a[_Maxof(char)]; /* { dg-error "ISO C does not support" } */
+int b[1 + _Minof(unsigned char)]; /* { dg-error "ISO C does not support" } */
diff --git a/gcc/testsuite/gcc.dg/maxof-compile.c
b/gcc/testsuite/gcc.dg/maxof-compile.c
index a9a7acaea04b..f59df75791bc 100644
--- a/gcc/testsuite/gcc.dg/maxof-compile.c
+++ b/gcc/testsuite/gcc.dg/maxof-compile.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-std=c2y -pedantic-errors" } */
+/* { dg-options "-std=gnu2y" } */
#define SCHAR_MAX __SCHAR_MAX__
#define SCHAR_MIN (-SCHAR_MAX - 1)
diff --git a/gcc/testsuite/gcc.dg/maxof-no-compat.c
b/gcc/testsuite/gcc.dg/maxof-no-compat.c
index e0d3fb94d85b..894ffabfc04a 100644
--- a/gcc/testsuite/gcc.dg/maxof-no-compat.c
+++ b/gcc/testsuite/gcc.dg/maxof-no-compat.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-std=c23 -pedantic-errors -Wno-c23-c2y-compat" } */
-int a[_Maxof(char)];
-int b[1 + _Minof(unsigned char)];
+int a[_Maxof(char)]; /* { dg-error "ISO C does not support" } */
+int b[1 + _Minof(unsigned char)]; /* { dg-error "ISO C does not support" } */
--
2.51.0