]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Always treat __float128 as a floating-point type
authorJonathan Wakely <jwakely@redhat.com>
Wed, 2 Jul 2025 20:16:30 +0000 (21:16 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 11 Jul 2025 07:34:17 +0000 (08:34 +0100)
commit25ea539b3de7bb94481eb07cb7d621a3a88de727
tree6ee7ffeba55ef74bea4ba064f456df004c4f8429
parent4faa42ac0dee2c26ed68f0df002837e7e1c95687
libstdc++: Always treat __float128 as a floating-point type

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>
libstdc++-v3/include/bits/cpp_type_traits.h
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/std/type_traits