https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121476
Bug ID: 121476 Summary: std::clamp is marked nodiscard, but std::ranges::clamp is not Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Target Milestone: --- We (reasonably, correctly) mark std::clamp [[nodiscard]], but don't do the same thing for the ranges-cpo's function call operator. That operator should also be marked [[nodiscard]] See https://github.com/gcc-mirror/gcc/blob/435e09e05c3750cad153c3c6e83134803c22c7f6/libstdc%2B%2B-v3/include/bits/stl_algo.h#L3634 and https://github.com/gcc-mirror/gcc/blob/435e09e05c3750cad153c3c6e83134803c22c7f6/libstdc%2B%2B-v3/include/bits/ranges_algo.h#L4232