From: Patrick Palka Date: Mon, 2 Feb 2026 20:20:37 +0000 (-0500) Subject: c++: update FTM for C++23 inherited CTAD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=041629c5b128b286570c7bc04dec80d5699b9cff;p=thirdparty%2Fgcc.git 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 Reviewed-by: Jason Merrill --- diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 12ddfa22074..48095988da5 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 4033552b2eb..06901afadb6 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 08c0ed457af..24811669961 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