Re: [committed] libstdc++: Fix three-way comparison for std::array [PR 96851]

2020-09-02 Thread Jonathan Wakely via Gcc-patches
On 02/09/20 15:51 +0100, Jonathan Wakely wrote: The spaceship operator for std::array uses memcmp when the __is_byte trait is true, but memcmp isn't usable in constexpr contexts. Also, memcmp should only be used for unsigned byte types, because it gives the wrong answer for signed chars with nega

[committed] libstdc++: Fix three-way comparison for std::array [PR 96851]

2020-09-02 Thread Jonathan Wakely via Gcc-patches
The spaceship operator for std::array uses memcmp when the __is_byte trait is true, but memcmp isn't usable in constexpr contexts. Also, memcmp should only be used for unsigned byte types, because it gives the wrong answer for signed chars with negative values. We can simply check std::is_constant