From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 244233858C35; Thu, 8 Feb 2024 15:50:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 244233858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707407459; bh=2gf/ByoKSwEteZgKLdl3sh+utcBZxsSBrszIJp7AiPQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hzjG+YNr0L050CyH4FK769rWXAc6VTNaIbjj4yWhbXCsNlDI8ctJcrnP9n7+ZYY4g qUJ6o7PY91kCvRRDI1Dm/jPEtDSBCyd8u3ifomPlLkwy5K7SU75qegmhglwGcTe42X i6dCfeQipooQfTMyRRVewWyDiW1mL5aWa0Z6lFus= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/90276] PSTL tests fail in Debug Mode Date: Thu, 08 Feb 2024 15:50:56 +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: 9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90276 --- Comment #14 from GCC Commits --- The releases/gcc-13 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:3c04a1533b32362c7c28fc32b05623dda45a1b44 commit r13-8304-g3c04a1533b32362c7c28fc32b05623dda45a1b44 Author: Jonathan Wakely Date: Wed Jan 31 10:41:49 2024 +0000 libstdc++: Avoid reusing moved-from iterators in PSTL tests [PR90276] The reverse_invoker utility for PSTL tests uses forwarding references f= or all parameters, but some of those parameters get forwarded to move constructors which then leave the objects in a moved-from state. When the parameters are forwarded a second time that results in making new copies of moved-from iterators. For libstdc++ debug mode iterators, the moved-from state is singular, which means copying them will abort at runtime. The fix is to make copies of iterator arguments instead of forwarding them. The callers of reverse_invoker::operator() also forward the iterators multiple times, but that's OK because reverse_invoker accepts them by forwarding reference but then breaks the chain of forwarding and copies them as lvalues. libstdc++-v3/ChangeLog: PR libstdc++/90276 * testsuite/util/pstl/test_utils.h (reverse_invoker): Do not use perfect forwarding for iterator arguments. (cherry picked from commit 723a7c1ad29523b9ddff53c7b147bffea56fbb63)=