[gcc r16-8803] c++, libstc++: Bump __cpp_impl_reflection and __cpp_lib_reflection
Jakub Jelinek
jakub@gcc.gnu.org
Wed Apr 22 13:04:37 GMT 2026
https://gcc.gnu.org/g:376d03b7b44da2328952f0212314a1f8e1241543
commit r16-8803-g376d03b7b44da2328952f0212314a1f8e1241543
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Apr 22 15:03:48 2026 +0200
c++, libstc++: Bump __cpp_impl_reflection and __cpp_lib_reflection
Both __cpp_impl_reflection and __cpp_lib_reflection were increased from
202506L to 202603L post Croydon, I assume to show that P3795R2 (maybe some
issues too) have been implemented.
Now, we do implement P3795R2 except for the is_applicable_type,
is_nothrow_applicable_type and apply_result metafunctions, but Jonathan says
there is agreement in LWG that to test for availability of those one should
test __cpp_lib_reflection >= 202603L && __cpp_lib_apply >= 202603L.
So, this patch bumps both FTMs.
2026-04-22 Jakub Jelinek <jakub@redhat.com>
gcc/c-family/
* c-cppbuiltin.cc (c_cpp_builtins): Bump __cpp_impl_reflection value
from 202506L to 202603L.
gcc/testsuite/
* g++.dg/DRs/dr2581-2.C: Adjust for __cpp_impl_reflection bump from
202506L to 202603L.
* g++.dg/reflect/feat1.C: Likewise. Also adjust for
__cpp_lib_reflection bump from 202506L to 202603L.
* g++.dg/reflect/feat2.C: Likewise.
* g++.dg/reflect/feat3.C: Likewise.
libstdc++-v3/
* include/bits/version.def (reflection): Bump 202506L to 202603L
for both v and in extra_cond.
* include/bits/version.h: Regenerate.
* include/std/meta: Compare __glibcxx_reflection against
202603L rather than 202506L.
* src/c++23/std.cc.in: Likewise.
Reviewed-by: Jason Merrill <jason@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Diff:
---
gcc/c-family/c-cppbuiltin.cc | 2 +-
gcc/testsuite/g++.dg/DRs/dr2581-2.C | 2 +-
gcc/testsuite/g++.dg/reflect/feat1.C | 8 ++++----
gcc/testsuite/g++.dg/reflect/feat2.C | 4 ++--
gcc/testsuite/g++.dg/reflect/feat3.C | 4 ++--
libstdc++-v3/include/bits/version.def | 4 ++--
libstdc++-v3/include/bits/version.h | 6 +++---
libstdc++-v3/include/std/meta | 2 +-
libstdc++-v3/src/c++23/std.cc.in | 2 +-
9 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 48095988da56..74cbeecb165e 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1119,7 +1119,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_constexpr_virtual_inheritance=202506L");
cpp_define (pfile, "__cpp_expansion_statements=202506L");
if (flag_reflection)
- cpp_define (pfile, "__cpp_impl_reflection=202506L");
+ cpp_define (pfile, "__cpp_impl_reflection=202603L");
else
cpp_warn (pfile, "__cpp_impl_reflection");
}
diff --git a/gcc/testsuite/g++.dg/DRs/dr2581-2.C b/gcc/testsuite/g++.dg/DRs/dr2581-2.C
index 77bf93b27410..0f2aec0e4255 100644
--- a/gcc/testsuite/g++.dg/DRs/dr2581-2.C
+++ b/gcc/testsuite/g++.dg/DRs/dr2581-2.C
@@ -64,7 +64,7 @@
#define __cpp_impl_coroutine 201902L // { dg-error "'__cpp_impl_coroutine' redefined" "" { target c++20 } }
#define __cpp_impl_destroying_delete 201806L // { dg-error "'__cpp_impl_destroying_delete' redefined" "" { target c++20 } }
#define __cpp_impl_three_way_comparison 201907L // { dg-error "'__cpp_impl_three_way_comparison' redefined" "" { target c++20 } }
-#define __cpp_impl_reflection 202506L // { dg-error "'__cpp_impl_reflection' redefined" "" { target c++26 } }
+#define __cpp_impl_reflection 202603L // { dg-error "'__cpp_impl_reflection' redefined" "" { target c++26 } }
#define __cpp_implicit_move 202207L // { dg-error "'__cpp_implicit_move' redefined" "" { target c++23 } }
#define __cpp_inheriting_constructors 201511L // { dg-error "'__cpp_inheriting_constructors' redefined" "" { target c++20 } }
#define __cpp_init_captures 201803L // { dg-error "'__cpp_init_captures' redefined" "" { target c++14 } }
diff --git a/gcc/testsuite/g++.dg/reflect/feat1.C b/gcc/testsuite/g++.dg/reflect/feat1.C
index a84946d6a808..e0ef6e31d3b3 100644
--- a/gcc/testsuite/g++.dg/reflect/feat1.C
+++ b/gcc/testsuite/g++.dg/reflect/feat1.C
@@ -4,14 +4,14 @@
#ifndef __cpp_impl_reflection
# error "__cpp_impl_reflection"
-#elif __cpp_impl_reflection != 202506
-# error "__cpp_impl_reflection != 202506"
+#elif __cpp_impl_reflection != 202603
+# error "__cpp_impl_reflection != 202603"
#endif
#include <meta>
#ifndef __cpp_lib_reflection
# error "__cpp_lib_reflection"
-#elif __cpp_lib_reflection != 202506
-# error "__cpp_lib_reflection != 202506"
+#elif __cpp_lib_reflection != 202603
+# error "__cpp_lib_reflection != 202603"
#endif
diff --git a/gcc/testsuite/g++.dg/reflect/feat2.C b/gcc/testsuite/g++.dg/reflect/feat2.C
index dc4c82cdaab9..a1e4c601290a 100644
--- a/gcc/testsuite/g++.dg/reflect/feat2.C
+++ b/gcc/testsuite/g++.dg/reflect/feat2.C
@@ -6,8 +6,8 @@
#ifndef __cpp_lib_reflection
# error "__cpp_lib_reflection"
-#elif __cpp_lib_reflection != 202506
-# error "__cpp_lib_reflection != 202506"
+#elif __cpp_lib_reflection != 202603
+# error "__cpp_lib_reflection != 202603"
#endif
#ifndef __cpp_lib_define_static
diff --git a/gcc/testsuite/g++.dg/reflect/feat3.C b/gcc/testsuite/g++.dg/reflect/feat3.C
index 68b72e27f39b..ee03b62fd2d8 100644
--- a/gcc/testsuite/g++.dg/reflect/feat3.C
+++ b/gcc/testsuite/g++.dg/reflect/feat3.C
@@ -6,8 +6,8 @@
#ifndef __cpp_lib_reflection
# error "__cpp_lib_reflection"
-#elif __cpp_lib_reflection != 202506
-# error "__cpp_lib_reflection != 202506"
+#elif __cpp_lib_reflection != 202603
+# error "__cpp_lib_reflection != 202603"
#endif
#ifndef __cpp_lib_define_static
diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
index 13dba4d63789..4db17a6d98c7 100644
--- a/libstdc++-v3/include/bits/version.def
+++ b/libstdc++-v3/include/bits/version.def
@@ -2337,9 +2337,9 @@ ftms = {
ftms = {
name = reflection;
values = {
- v = 202506;
+ v = 202603;
cxxmin = 26;
- extra_cond = "__cpp_impl_reflection >= 202506L";
+ extra_cond = "__cpp_impl_reflection >= 202603L";
cxx11abi = yes;
};
};
diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h
index 743f7e29fe29..62bc83f7ea12 100644
--- a/libstdc++-v3/include/bits/version.h
+++ b/libstdc++-v3/include/bits/version.h
@@ -2602,10 +2602,10 @@
#undef __glibcxx_want_philox_engine
#if !defined(__cpp_lib_reflection)
-# if (__cplusplus > 202302L) && _GLIBCXX_USE_CXX11_ABI && (__cpp_impl_reflection >= 202506L)
-# define __glibcxx_reflection 202506L
+# if (__cplusplus > 202302L) && _GLIBCXX_USE_CXX11_ABI && (__cpp_impl_reflection >= 202603L)
+# define __glibcxx_reflection 202603L
# if defined(__glibcxx_want_all) || defined(__glibcxx_want_reflection)
-# define __cpp_lib_reflection 202506L
+# define __cpp_lib_reflection 202603L
# endif
# endif
#endif /* !defined(__cpp_lib_reflection) */
diff --git a/libstdc++-v3/include/std/meta b/libstdc++-v3/include/std/meta
index b12f49a20963..21a4df45bfc0 100644
--- a/libstdc++-v3/include/std/meta
+++ b/libstdc++-v3/include/std/meta
@@ -37,7 +37,7 @@
#define __glibcxx_want_define_static
#include <bits/version.h>
-#if __glibcxx_reflection >= 202506L // C++ >= 26 && __cpp_impl_reflection
+#if __glibcxx_reflection >= 202603L // C++ >= 26 && __cpp_impl_reflection
#include <array>
#include <initializer_list>
diff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/std.cc.in
index ad249cb3348e..dbed0112dca5 100644
--- a/libstdc++-v3/src/c++23/std.cc.in
+++ b/libstdc++-v3/src/c++23/std.cc.in
@@ -2083,7 +2083,7 @@ export namespace std::pmr
}
// <meta>
-#if __glibcxx_reflection >= 202506L
+#if __glibcxx_reflection >= 202603L
export namespace std
{
#if __has_builtin(__builtin_is_string_literal)
More information about the Libstdc++-cvs
mailing list