https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105609
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:3866ca796d5281d33f25b4165badacf8f198c6d1 commit r15-7765-g3866ca796d5281d33f25b4165badacf8f198c6d1 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.