https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112349

--- Comment #4 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:f236c897af48c3ae52095a894d57e66065b8ad87

commit r14-11174-gf236c897af48c3ae52095a894d57e66065b8ad87
Author: Patrick Palka <ppa...@redhat.com>
Date:   Fri Dec 13 13:17:29 2024 -0500

    libstdc++: Avoid unnecessary copies in ranges::min/max [PR112349]

    Use a local reference for the (now possibly lifetime extended) result of
    *__first so that we copy it only when necessary.

            PR libstdc++/112349

    libstdc++-v3/ChangeLog:

            * include/bits/ranges_algo.h (__min_fn::operator()): Turn local
            object __tmp into a reference.
            * include/bits/ranges_util.h (__max_fn::operator()): Likewise.
            * testsuite/25_algorithms/max/constrained.cc (test04): New test.
            * testsuite/25_algorithms/min/constrained.cc (test04): New test.

    Reviewed-by: Jonathan Wakely <jwak...@redhat.com>
    (cherry picked from commit b8314ebff2495ee22f9e2203093bdada9843a0f5)

Reply via email to