PR c++/86982, -Wreturn-local-addr and std::move and std::forward.
commit308d9cda32faed5d49ce3d0732b4ff465c423300
authorMarek Polacek <polacek@redhat.com>
Thu, 6 Sep 2018 00:38:13 +0000 (6 00:38 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 6 Sep 2018 00:38:13 +0000 (6 00:38 +0000)
tree8c35a937933ae3e55c78546616653aa06d11b0e0
parent4497d88fe2cbf9d8210485e68123a9abac693297
PR c++/86982, -Wreturn-local-addr and std::move and std::forward.

* typeck.c (maybe_warn_about_returning_address_of_local): Handle calls
to std::move or std::forward.
(is_std_forward_p): New function.

* g++.dg/warn/Wreturn-local-addr-5.C: New test.

From-SVN: r264139
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wreturn-local-addr-5.C [new file with mode: 0644]