public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/81159] New warning idea: -Wself-move
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
@ 2022-08-09 18:04 ` mpolacek at gcc dot gnu.org
2022-08-26 18:02 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-08-09 18:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Patch posted: https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599503.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/81159] New warning idea: -Wself-move
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
2022-08-09 18:04 ` [Bug c++/81159] New warning idea: -Wself-move mpolacek at gcc dot gnu.org
@ 2022-08-26 18:02 ` cvs-commit at gcc dot gnu.org
2022-08-26 18:03 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-08-26 18:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:0abb78dda084a14b3d955757c6431fff71c263f3
commit r13-2227-g0abb78dda084a14b3d955757c6431fff71c263f3
Author: Marek Polacek <polacek@redhat.com>
Date: Mon Aug 8 17:45:28 2022 -0400
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/81159] New warning idea: -Wself-move
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
2022-08-09 18:04 ` [Bug c++/81159] New warning idea: -Wself-move mpolacek at gcc dot gnu.org
2022-08-26 18:02 ` cvs-commit at gcc dot gnu.org
@ 2022-08-26 18:03 ` mpolacek at gcc dot gnu.org
2022-08-26 18:05 ` simon.marchi at polymtl dot ca
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-08-26 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Implemented in GCC 13.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/81159] New warning idea: -Wself-move
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2022-08-26 18:03 ` mpolacek at gcc dot gnu.org
@ 2022-08-26 18:05 ` simon.marchi at polymtl dot ca
2022-10-01 8:20 ` jbglaw@lug-owl.de
2022-11-28 22:40 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: simon.marchi at polymtl dot ca @ 2022-08-26 18:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159
--- Comment #11 from Simon Marchi <simon.marchi at polymtl dot ca> ---
Awesome, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/81159] New warning idea: -Wself-move
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2022-08-26 18:05 ` simon.marchi at polymtl dot ca
@ 2022-10-01 8:20 ` jbglaw@lug-owl.de
2022-11-28 22:40 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: jbglaw@lug-owl.de @ 2022-10-01 8:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159
Jan-Benedict Glaw <jbglaw@lug-owl.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jbglaw@lug-owl.de
--- Comment #12 from Jan-Benedict Glaw <jbglaw@lug-owl.de> ---
Just ftr: Building GDB with a recent GCC now breaks since GDB is testing
-Wself-move in its unittests, but only covers the warning in case of clang.
Found by my automated builders. I proposed a patch to fix that.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/81159] New warning idea: -Wself-move
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2022-10-01 8:20 ` jbglaw@lug-owl.de
@ 2022-11-28 22:40 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81159
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-28 22:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-81159-4@http.gcc.gnu.org/bugzilla/>
2022-08-09 18:04 ` [Bug c++/81159] New warning idea: -Wself-move mpolacek at gcc dot gnu.org
2022-08-26 18:02 ` cvs-commit at gcc dot gnu.org
2022-08-26 18:03 ` mpolacek at gcc dot gnu.org
2022-08-26 18:05 ` simon.marchi at polymtl dot ca
2022-10-01 8:20 ` jbglaw@lug-owl.de
2022-11-28 22:40 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).