libstdc++: Use _M_reverse to reverse partial_ordering using operator<=>

The patch r16-3414-gfcb3009a32dc33 changed the representation of unordered to
optimize reversing of order, but it did not update implementation of reversing
operator<=>(0, partial_order).

libstdc++-v3/ChangeLog:

	* libsupc++/compare
	(operator<=>(__cmp_cat::__unspec, partial_ordering)):
	Implement using _M_reverse.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
This commit is contained in:
Tomasz Kamiński
2025-08-27 16:43:16 +02:00
parent 806de30f51
commit b3038e1ace

View File

@@ -155,12 +155,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
[[nodiscard]]
friend constexpr partial_ordering
operator<=>(__cmp_cat::__unspec, partial_ordering __v) noexcept
{
if (__v._M_value & 1)
return partial_ordering(__cmp_cat::_Ord(-__v._M_value));
else
return __v;
}
{ return partial_ordering(__cmp_cat::_Ncmp(__v._M_reverse())); }
};
// valid values' definitions