https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100249
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:d121d1e1dd874731a648086772e6c40e34fa5de9 commit r14-11251-gd121d1e1dd874731a648086772e6c40e34fa5de9 Author: Giuseppe D'Angelo <giuseppe.dang...@kdab.com> Date: Sun Jan 19 16:30:20 2025 +0100 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.dang...@kdab.com> Reviewed-by: Patrick Palka <ppa...@redhat.com> Reviewed-by: Jonathan Wakely <jwak...@redhat.com> (cherry picked from commit b342614139c0a981b369176980663941b9c27f39)