https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101587
--- Comment #9 from 康桓瑋 <hewillk at gmail dot com> --- (In reply to GCC Commits from comment #8) > The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: > > https://gcc.gnu.org/g:f4b6acfc36fb1f72fdd5bf4da208515e6495a062 > > commit r15-8980-gf4b6acfc36fb1f72fdd5bf4da208515e6495a062 > 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. Still need casting the return difference type from __mindist, I think?