Similar to the previous commit that made is_integral_v<__int128>
unconditionally true, this makes is_floating_point_v<__float128>
unconditionally true. With the new extended floating-point types in
C++23 (std::float64_t etc.) it seems unhelpful for is_floating_point_v
to be true for them, but not for __float128. Especially as it is true on
some targets, because __float128 is just a typedef for long double.
This change makes is_floating_point_v<__float128> true whenever the type
is defined, giving less surprising and more portable behaviour.
libstdc++-v3/ChangeLog:
* include/bits/cpp_type_traits.h (__is_floating<__float128>):
Do not depend on __STRICT_ANSI__.
* include/bits/stl_algobase.h (__size_to_integer(__float128)):
Likewise.
* include/std/type_traits (__is_floating_point_helper<__float128>):
Likewise.
Reviewed-by: Patrick Palka <ppalka@redhat.com>
typedef __true_type __type;
};
+#ifdef _GLIBCXX_USE_FLOAT128
+ template<>
+ struct __is_floating<__float128>
+ {
+ enum { __value = 1 };
+ typedef __true_type __type;
+ };
+#endif
+
#ifdef __STDCPP_FLOAT16_T__
template<>
struct __is_floating<_Float16>
__size_to_integer(double __n) { return (long long)__n; }
inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(long double __n) { return (long long)__n; }
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#ifdef _GLIBCXX_USE_FLOAT128
__extension__ inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(__float128 __n) { return (long long)__n; }
#endif
: public true_type { };
#endif
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#ifdef _GLIBCXX_USE_FLOAT128
template<>
struct __is_floating_point_helper<__float128>
: public true_type { };