https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100249
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:b342614139c0a981b369176980663941b9c27f39 commit r15-7066-gb342614139c0a981b369176980663941b9c27f39 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>