https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113960

--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:3a16060d605a087fb4cf0bc3b53ed93b5875cd62

commit r13-8377-g3a16060d605a087fb4cf0bc3b53ed93b5875cd62
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Feb 27 17:50:34 2024 +0000

    libstdc++: Fix conditions for using memcmp in
std::lexicographical_compare_three_way [PR113960]

    The change in r11-2981-g2f983fa69005b6 meant that
    std::lexicographical_compare_three_way started to use memcmp for
    unsigned integers on big endian targets, but for that to be valid we
    need the two value types to have the same size and we need to use that
    size to compute the length passed to memcmp.

    I already defined a __is_memcmp_ordered_with trait that does the right
    checks, std::lexicographical_compare_three_way just needs to use it.

    libstdc++-v3/ChangeLog:

            PR libstdc++/113960
            * include/bits/stl_algobase.h (__is_byte_iter): Replace with ...
            (__memcmp_ordered_with): New concept.
            (lexicographical_compare_three_way): Use __memcmp_ordered_with
            instead of __is_byte_iter. Use correct length for memcmp.
            *
testsuite/25_algorithms/lexicographical_compare_three_way/113960.cc:
            New test.

    (cherry picked from commit f5cdda8acb06c20335855ed353ab9a441c12128a)

Reply via email to