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));