From: Jakub Jelinek Date: Tue, 20 Jan 2026 11:01:07 +0000 (+0100) Subject: libstdc++: Disable __cpp_lib_reflection for old CXX ABI X-Git-Tag: basepoints/gcc-17~1887 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23cd6f3bcb494606afe82a490b10f64f660d8143;p=thirdparty%2Fgcc.git libstdc++: Disable __cpp_lib_reflection for old CXX ABI Reflection currently doesn't work with -D_GLIBCXX_USE_CXX11_ABI=0. The problem is that std::meta::exception currently uses under the hood std::string and std::u8string and those aren't constexpr in the old ABI. While those members are in the standard exposition-only and so we could make it to work by writing a custom class template that just remembers const char{,8_t} * and size_t, there shouldn't be many people trying to use C++26 features with the ABI that isn't even compatible with C++11. 2026-01-20 Jakub Jelinek * include/bits/version.def (reflection): Add cxx11abi = yes;. * include/bits/version.h: Regenerate. --- diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def index 175e695a96d..8bb3e8d185f 100644 --- a/libstdc++-v3/include/bits/version.def +++ b/libstdc++-v3/include/bits/version.def @@ -2259,6 +2259,7 @@ ftms = { v = 202506; cxxmin = 26; extra_cond = "__cpp_impl_reflection >= 202506L"; + cxx11abi = yes; }; }; diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h index 020c256ca0c..107b19002d7 100644 --- a/libstdc++-v3/include/bits/version.h +++ b/libstdc++-v3/include/bits/version.h @@ -2526,6 +2526,16 @@ #endif /* !defined(__cpp_lib_philox_engine) */ #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 defined(__glibcxx_want_all) || defined(__glibcxx_want_reflection) +# define __cpp_lib_reflection 202506L +# endif +# endif +#endif /* !defined(__cpp_lib_reflection) */ +#undef __glibcxx_want_reflection + #if !defined(__cpp_lib_is_implicit_lifetime) # if (__cplusplus >= 202100L) && (__has_builtin(__builtin_is_implicit_lifetime)) # define __glibcxx_is_implicit_lifetime 202302L @@ -2536,14 +2546,4 @@ #endif /* !defined(__cpp_lib_is_implicit_lifetime) */ #undef __glibcxx_want_is_implicit_lifetime -#if !defined(__cpp_lib_reflection) -# if (__cplusplus > 202302L) && (__cpp_impl_reflection >= 202506L) -# define __glibcxx_reflection 202506L -# if defined(__glibcxx_want_all) || defined(__glibcxx_want_reflection) -# define __cpp_lib_reflection 202506L -# endif -# endif -#endif /* !defined(__cpp_lib_reflection) */ -#undef __glibcxx_want_reflection - #undef __glibcxx_want_all