[Bug libstdc++/93972] ranges::lexicographical_compare gives wrong answer for signed integers
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 28 18:31:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93972
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-02-28
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Or for unsigned integral types wider than a byte...
#include <algorithm>
#include <assert.h>
int main()
{
unsigned i[] = { 1 };
unsigned j[] = { 256 };
assert( std::ranges::lexicographical_compare(i, j) );
}
Apparently I didn't consult the memcmp check that's used by
std::lexicographical_compare when writing the ranges version.
More information about the Gcc-bugs
mailing list