diff options
author | Marek Polacek <polacek@redhat.com> | 2022-08-08 17:45:28 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2022-08-26 12:56:34 -0400 |
commit | 0abb78dda084a14b3d955757c6431fff71c263f3 (patch) | |
tree | e50c14d175e4d5e2e61ea340f47f00f92cf039a6 /libgcc/enable-execute-stack-mprotect.c | |
parent | 1e2462890ac748a5e5b6a34fdeb61e7027863a90 (diff) | |
download | gcc-0abb78dda084a14b3d955757c6431fff71c263f3.zip gcc-0abb78dda084a14b3d955757c6431fff71c263f3.tar.gz gcc-0abb78dda084a14b3d955757c6431fff71c263f3.tar.bz2 |
c++: Implement -Wself-move warning [PR81159]
About 5 years ago we got a request to implement -Wself-move, which
warns about useless moves like this:
int x;
x = std::move (x);
This patch implements that warning.
PR c++/81159
gcc/c-family/ChangeLog:
* c.opt (Wself-move): New option.
gcc/cp/ChangeLog:
* typeck.cc (maybe_warn_self_move): New.
(cp_build_modify_expr): Call maybe_warn_self_move.
gcc/ChangeLog:
* doc/invoke.texi: Document -Wself-move.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wself-move1.C: New test.
Diffstat (limited to 'libgcc/enable-execute-stack-mprotect.c')
0 files changed, 0 insertions, 0 deletions