]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: perfectly forward std::ranges::clamp arguments
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Sun, 19 Jan 2025 15:30:20 +0000 (16:30 +0100)
committerPatrick Palka <ppalka@redhat.com>
Mon, 20 Jan 2025 15:49:48 +0000 (10:49 -0500)
commitb342614139c0a981b369176980663941b9c27f39
treead8dbd76489ef7cfccb14be00a030b44fd58ed57
parent7cc573017274acfd5a276d959a8297ba04e98002
libstdc++: perfectly forward std::ranges::clamp arguments

As reported in PR118185, std::ranges::clamp does not correctly forward
the projected value to the comparator. Add the missing forward.

libstdc++-v3/ChangeLog:

PR libstdc++/118185
PR libstdc++/100249
* include/bits/ranges_algo.h (__clamp_fn): Correctly forward the
projected value to the comparator.
* testsuite/25_algorithms/clamp/118185.cc: New test.

Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/bits/ranges_algo.h
libstdc++-v3/testsuite/25_algorithms/clamp/118185.cc [new file with mode: 0644]