From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E1DDC3858428; Wed, 13 Oct 2021 13:56:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1DDC3858428 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100187] Helper lambda in ranges_algo.h misses forwarding return type Date: Wed, 13 Oct 2021 13:56:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2021 13:56:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100187 --- Comment #7 from CVS Commits --- The releases/gcc-10 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:139bafaaba0c775ca65712621bd60e079b488d73 commit r10-10210-g139bafaaba0c775ca65712621bd60e079b488d73 Author: Patrick Palka Date: Tue Apr 27 23:21:19 2021 -0400 libstdc++: Fix various bugs in ranges_algo.h [PR100187, ...] This fixes some bugs with our ranges algorithms in uncommon situations, such as when the return type of a predicate is a non-copyable class type that's implicitly convertible to bool (PR100187), when a comparison predicate isn't invocable as an rvalue (PR100237), and when the return type of a projection function is non-copyable (PR100249). This also fixes PR100287, which reports that we're moving __first twice when constructing with it an empty subrange in ranges::partition. libstdc++-v3/ChangeLog: PR libstdc++/100187 PR libstdc++/100237 PR libstdc++/100249 PR libstdc++/100287 * include/bits/ranges_algo.h (__search_n_fn::operator()): Give the __value_comp lambda an explicit bool return type. (__is_permutation_fn::operator()): Give the __proj_scan local variable auto&& return type. Give the __comp_scan lambda an explicit bool return type. (__remove_fn::operator()): Give the __pred lambda an explicit bool return type. (__partition_fn::operator()): Don't std::move __first twice when returning an empty subrange. (__min_fn::operator()): Don't std::move __comp. (__max_fn::operator()): Likewise. (__minmax_fn::operator()): Likewise. (cherry picked from commit d91e7eab3a2c3957c2220ad71e62d9fc78cccb9b)=