https://gcc.gnu.org/g:041629c5b128b286570c7bc04dec80d5699b9cff

commit r16-7247-g041629c5b128b286570c7bc04dec80d5699b9cff
Author: Patrick Palka <[email protected]>
Date:   Mon Feb 2 15:20:37 2026 -0500

    c++: update FTM for C++23 inherited CTAD
    
    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 <[email protected]>
    Reviewed-by: Jason Merrill <[email protected]>

Diff:
---
 gcc/c-family/c-cppbuiltin.cc            | 4 +++-
 gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C | 4 ++--
 gcc/testsuite/g++.dg/cpp26/feat-cxx26.C | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 12ddfa22074c..48095988da56 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 4033552b2ebc..06901afadb62 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 08c0ed457af3..248116699617 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

Reply via email to