PR c++/89660 - bogus error with -Wredundant-move.
authorMarek Polacek <polacek@redhat.com>
Wed, 13 Mar 2019 20:04:33 +0000 (20:04 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 13 Mar 2019 20:04:33 +0000 (20:04 +0000)
commitef7e79a3672d1b013646a1a6f8cd5931ef6bcd07
treed47d790bc1e4b4c797c2003990ee1dbb7dcbf811
parent2b0a62741e675068c13e81690758855846c88726
PR c++/89660 - bogus error with -Wredundant-move.

* typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
as the std::move's argument.  Don't call convert_for_initialization
when warn_redundant_move isn't on.

* g++.dg/cpp0x/Wredundant-move8.C: New test.
* g++.dg/cpp0x/Wredundant-move9.C: New test.

From-SVN: r269660
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/Wredundant-move8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C [new file with mode: 0644]