From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B177384D147; Wed, 7 Sep 2022 14:16:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B177384D147 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662560174; bh=j4zu0TvbmunioRfN5JrtajnTQqWl+P9sIaSvc96x+/k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a6oEbKp/SBdbgMThn3GiwatMxfltU19ThwlaIaEENlPG0tPUCi2fT42uuLZUtKUTw xkz0cinqYMdiMWtXbjFtdTWlECR47YmHpeY1U7ABbAAfa7urx+/SpY0BUnxxqNBzqe 9KgKLhLiVcOhSodSsZ7Fd/j97TaagE8xKTwJMSOY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106695] [11/12 Regression] Explicit copy constructor does not work for a parameter passed via std::async Date: Wed, 07 Sep 2022 14:16:13 +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.1.0 X-Bugzilla-Keywords: rejects-valid 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: 11.4 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=3D106695 --- Comment #4 from CVS Commits --- The releases/gcc-12 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:47f0bd269403762ddb71b8c6165b30ace4f70a8b commit r12-8747-g47f0bd269403762ddb71b8c6165b30ace4f70a8b Author: Jonathan Wakely Date: Mon Aug 22 15:42:17 2022 +0100 libstdc++: Fix for explicit copy ctors in and [PR1066= 95] When I changed std::thread and std::async to avoid unnecessary move construction of temporaries, I introduced a regression where types with an explicit copy constructor could not be passed to std::thread or std::async. The fix is to add a constructor instead of using aggregate initialization of an unnamed temporary. libstdc++-v3/ChangeLog: PR libstdc++/106695 * include/bits/std_thread.h (thread::_State_impl): Forward individual arguments to _Invoker constructor. (thread::_Invoker): Add constructor. Delete copies. * include/std/future (__future_base::_Deferred_state): Forward individual arguments to _Invoker constructor. (__future_base::_Async_state_impl): Likewise. * testsuite/30_threads/async/106695.cc: New test. * testsuite/30_threads/thread/106695.cc: New test. (cherry picked from commit 5abe0657553580bd1b7488dd84d55138a8d9f23c)=