[Bug c++/52901] invalid rvalue reference
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Apr 8 18:06:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52901
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-08 18:05:49 UTC ---
(In reply to comment #3)
> g++ warns for
>
> return X();
> return static_cast<X&&>(x);
>
> but not
>
> return std::move(x);
Nor for
X& g(X& x) { return x; }
X& f() {
X x;
return g(x);
}
I opened PR 49974 to request a warning there, we don't need another :)
More information about the Gcc-bugs
mailing list