This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/60966] std::call_once sometime hangs
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Apr 2014 18:36:30 +0000
- Subject: [Bug libstdc++/60966] std::call_once sometime hangs
- Auto-submitted: auto-generated
- References: <bug-60966-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60966
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> > N.B. the std::move in Manager::cancelConnection is redundant, the return
> > value from cancel_connection is already an rvalue.
>
> Yes, I know, the problem is I have some hard time to avoid doing this as it
> is more for me and what I expect the compiler to do or the semantics I want
> the code to have :)
OK, but it makes the code worse. Here the compiler will elide the move
constructor (aka return value optimisation):
auto future = cancel_connection(c);
Whereas here the compiler cannot do that and must call a move constructor:
auto future = std::move(cancel_connection(c));