Message ID | 20240208160109.2697643-1-jwakely@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed] libstdc++: Guard tr2::bases and tr2::direct_bases with __has_builtin | expand |
On Thu, 8 Feb 2024 at 16:02, Jonathan Wakely wrote: > Tested x86_64-linux. Pusued to trunk. I'll backport it too. > Only to gcc-13 though, because __has_builtin(__bases) is false for gcc-12.
diff --git a/libstdc++-v3/include/tr2/type_traits b/libstdc++-v3/include/tr2/type_traits index a7ebaf66947..603039de894 100644 --- a/libstdc++-v3/include/tr2/type_traits +++ b/libstdc++-v3/include/tr2/type_traits @@ -82,20 +82,23 @@ namespace tr2 /// Sequence abstraction metafunctions for manipulating a typelist. - +#if __has_builtin(__bases) /// Enumerate all the base classes of a class. Form of a typelist. template<typename _Tp> struct bases { typedef __reflection_typelist<__bases(_Tp)...> type; }; +#endif +#if __has_builtin(__direct_bases) /// Enumerate all the direct base classes of a class. Form of a typelist. template<typename _Tp> struct direct_bases { typedef __reflection_typelist<__direct_bases(_Tp)...> type; }; +#endif /// @} group metaprogramming }