[Bug libstdc++/106695] [11/12/13 Regression] Explicit copy constructor does not work for a parameter passed via std::async

2022-08-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106695

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:5abe0657553580bd1b7488dd84d55138a8d9f23c

commit r13-2144-g5abe0657553580bd1b7488dd84d55138a8d9f23c
Author: Jonathan Wakely 
Date:   Mon Aug 22 15:42:17 2022 +0100

libstdc++: Fix for explicit copy ctors in  and  [PR106695]

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.

[Bug libstdc++/106695] [11/12/13 Regression] Explicit copy constructor does not work for a parameter passed via std::async

2022-08-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106695

Jonathan Wakely  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug libstdc++/106695] [11/12/13 Regression] Explicit copy constructor does not work for a parameter passed via std::async

2022-08-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106695

--- Comment #2 from Jonathan Wakely  ---
Probably r11-2736-gbb1b7f087bdd02

[Bug libstdc++/106695] [11/12/13 Regression] Explicit copy constructor does not work for a parameter passed via std::async

2022-08-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106695

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-08-22
 CC||jwakely.gcc at gmail dot com,
   ||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
It's very likely related to change in header files.

[Bug libstdc++/106695] [11/12/13 Regression] Explicit copy constructor does not work for a parameter passed via std::async

2022-08-22 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106695

Richard Biener  changed:

   What|Removed |Added

  Known to work||10.3.0
Summary|Regression 11,12: Explicit  |[11/12/13 Regression]
   |copy constructor does not   |Explicit copy constructor
   |work for a parameter passed |does not work for a
   |via std::async  |parameter passed via
   ||std::async
   Target Milestone|--- |11.4
   Keywords||rejects-valid