[Bug c++/87300] -Wredundant-move gives false positives in C++11 mode
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 14 19:20:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87300
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes
The first published standard to include the change was C++14 but it's a DR
against the previous standard. That means it's fixing a bug in the previous
standard.
The -std=c++11 flag is documented to mean C++11 *plus amendments*.
Also, the point of the warning is to alert you to pessimised code, which is
definitely the case here. Without the std::move the code compiles and can elide
the move construction. With the std::move a new object must be constructed.
More information about the Gcc-bugs
mailing list