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

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

https://gcc.gnu.org/g:c29c3f713a9d166eb18c68645b9675d01421ccf6

commit r14-11625-gc29c3f713a9d166eb18c68645b9675d01421ccf6
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Feb 27 13:27:17 2025 +0000

    libstdc++: Fix ranges::move and ranges::move_backward to use iter_move
[PR105609]

    The ranges::move and ranges::move_backward algorithms are supposed to
    use ranges::iter_move(iter) instead of std::move(*iter), which matters
    for an iterator type with an iter_move overload findable by ADL.

    Currently those algorithms use std::__assign_one which uses std::move,
    so define a new ranges::__detail::__assign_one helper function that uses
    ranges::iter_move.

    libstdc++-v3/ChangeLog:

            PR libstdc++/105609
            * include/bits/ranges_algobase.h (__detail::__assign_one): New
            helper function.
            (__copy_or_move, __copy_or_move_backward): Use new function
            instead of std::__assign_one.
            * testsuite/25_algorithms/move/constrained.cc: Check that
            ADL iter_move is used in preference to std::move.
            * testsuite/25_algorithms/move_backward/constrained.cc:
            Likewise.

    (cherry picked from commit 3866ca796d5281d33f25b4165badacf8f198c6d1)

Reply via email to