[committed] libstdc++: Fix -Wunused-local-typedefs warning in <compare>

Jonathan Wakely jwakely@redhat.com
Fri Mar 4 11:30:56 GMT 2022

On 03/03/22 22:38 +0000, Jonathan Wakely wrote:
>Tested x86_64-linux (-m32/-m64), powerpc64-linux (-m32/-m64),
>powerpc64le-linux, powerpc-aix (maix32/-maix64/-mlong-double-128).
>Pushed to trunk. I'm inclined to backport this to gcc-11 after some soak
>time on trunk (but not gcc-10, because it needs __builtin_bit_cast).
>-- >8 --
>This removes a FIXME in <compare>, defining the total order for
>floating-point types. I originally opened PR96526 to request a new
>compiler built-in to implement this, but now that we have std::bit_cast
>it can be done entirely in the library.
>The implementation is based on the glibc definitions of totalorder,
>totalorderf, totalorderl etc.
>I think this works for all the types that satisfy std::floating_point
>today, and should also work for the types expected to be added by P1467
>except for std::bfloat16_t. It also supports some additional types that
>don't currently satisfy std::floating_point, such as __float80, but we
>probably do want that to satisfy the concept for non-strict modes.
>	PR libstdc++/96526
>	* libsupc++/compare (strong_order): Add missing support for
>	floating-point types.
>	* testsuite/18_support/comparisons/algorithms/strong_order_floats.cc:
>	New test.

That commit produces a warning due to a typedef that is only needed
for some targets, which caused:

FAIL: g++.dg/warn/Wstringop-overflow-6.C  -std=gnu++20 (test for excess errors)

Here's the fix. Tested x86_64-linux, pushed to trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220304/7407dd90/attachment.bin>

More information about the Gcc-patches mailing list