aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2026-02-02 15:20:37 -0500
committerPatrick Palka <ppalka@redhat.com>2026-02-02 15:20:37 -0500
commit041629c5b128b286570c7bc04dec80d5699b9cff (patch)
treec31ced4db8a99493c05f792bbd1354f0470ca517
parent8978da072f9ea7653416d59167a07e79be6cadaf (diff)
downloadgcc-trunk.zip
gcc-trunk.tar.gz
gcc-trunk.tar.bz2
c++: update FTM for C++23 inherited CTADHEADtrunkmaster
We implement inherited CTAD (P2582R1) since GCC 14 but the corresponding FTM hasn't been updated in the standard until recently[1]. [1]: https://github.com/cplusplus/draft/pull/8450 gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Bump __cpp_deduction_guides to 202207L for C++23 and later. gcc/testsuite/ChangeLog: * g++.dg/cpp23/feat-cxx2b.C: Adjust expected __cpp_deduction_guides value. * g++.dg/cpp26/feat-cxx26.C: Likewise. Reviewed-by: Jakub Jelinek <jakub@redhat.com> Reviewed-by: Jason Merrill <jason@redhat.com>
-rw-r--r--gcc/c-family/c-cppbuiltin.cc4
-rw-r--r--gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp26/feat-cxx26.C4
3 files changed, 7 insertions, 5 deletions
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 12ddfa2..4809598 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1079,7 +1079,8 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_conditional_explicit=201806L");
cpp_define (pfile, "__cpp_consteval=202211L");
cpp_define (pfile, "__cpp_constinit=201907L");
- cpp_define (pfile, "__cpp_deduction_guides=201907L");
+ if (cxx_dialect <= cxx20)
+ cpp_define (pfile, "__cpp_deduction_guides=201907L");
cpp_define (pfile, "__cpp_nontype_template_args=201911L");
cpp_define (pfile, "__cpp_nontype_template_parameter_class=201806L");
cpp_define (pfile, "__cpp_impl_destroying_delete=201806L");
@@ -1096,6 +1097,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_auto_cast=202110L");
if (cxx_dialect <= cxx23)
cpp_define (pfile, "__cpp_constexpr=202211L");
+ cpp_define (pfile, "__cpp_deduction_guides=202207L");
cpp_define (pfile, "__cpp_multidimensional_subscript=202211L");
cpp_define (pfile, "__cpp_named_character_escapes=202207L");
cpp_define (pfile, "__cpp_static_call_operator=202207L");
diff --git a/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C b/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
index 4033552..06901af 100644
--- a/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
+++ b/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
@@ -353,8 +353,8 @@
#ifndef __cpp_deduction_guides
# error "__cpp_deduction_guides"
-#elif __cpp_deduction_guides != 201907
-# error "__cpp_deduction_guides != 201907"
+#elif __cpp_deduction_guides != 202207
+# error "__cpp_deduction_guides != 202207"
#endif
#ifndef __cpp_if_constexpr
diff --git a/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C b/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C
index 08c0ed4..2481166 100644
--- a/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C
+++ b/gcc/testsuite/g++.dg/cpp26/feat-cxx26.C
@@ -353,8 +353,8 @@
#ifndef __cpp_deduction_guides
# error "__cpp_deduction_guides"
-#elif __cpp_deduction_guides != 201907
-# error "__cpp_deduction_guides != 201907"
+#elif __cpp_deduction_guides != 202207
+# error "__cpp_deduction_guides != 202207"
#endif
#ifndef __cpp_if_constexpr