https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101587
--- Comment #15 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:b07ff1f34c0e74b7d812baa1bd5987ba2c8b9625 commit r13-9498-gb07ff1f34c0e74b7d812baa1bd5987ba2c8b9625 Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Mar 26 11:47:05 2025 +0000 libstdc++: Replace use of std::min in ranges::uninitialized_xxx algos [PR101587] Because ranges can have any signed integer-like type as difference_type, it's not valid to use std::min(diff1, diff2). Instead of calling std::min with an explicit template argument, this adds a new __mindist helper that determines the common type and uses that with std::min. libstdc++-v3/ChangeLog: PR libstdc++/101587 * include/bits/ranges_uninitialized.h (__detail::__mindist): New function object. (ranges::uninitialized_copy, ranges::uninitialized_copy_n) (ranges::uninitialized_move, ranges::uninitialized_move_n): Use __mindist instead of std::min. * testsuite/20_util/specialized_algorithms/uninitialized_copy/constrained.cc: Check ranges with difference difference types. * testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc: Likewise. (cherry picked from commit f4b6acfc36fb1f72fdd5bf4da208515e6495a062)