[Bug c++/49974] missing warning for indirectly returning reference to local/temporary

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Apr 8 18:15:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-08 18:15:04 UTC ---
As pointed out in PR 52901 comment 3, this missing warning is likely to bite
people misusing std::move like so:

X&& f()
{
  X x;
  return std::move(x);
}



More information about the Gcc-bugs mailing list