diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-03-26 11:47:05 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-03-27 15:26:32 +0000 |
commit | f4b6acfc36fb1f72fdd5bf4da208515e6495a062 (patch) | |
tree | 444e269f1ac25354746f1b42fa52f08418f5fcd9 /gcc/testsuite/c-c++-common/strub-strict1.c | |
parent | 16766d5a0c4a946d3ba9255a99621975b9773e18 (diff) | |
download | gcc-f4b6acfc36fb1f72fdd5bf4da208515e6495a062.zip gcc-f4b6acfc36fb1f72fdd5bf4da208515e6495a062.tar.gz gcc-f4b6acfc36fb1f72fdd5bf4da208515e6495a062.tar.bz2 |
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.
Diffstat (limited to 'gcc/testsuite/c-c++-common/strub-strict1.c')
0 files changed, 0 insertions, 0 deletions