public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/81159] New warning idea: -Wself-move
Date: Fri, 26 Aug 2022 18:02:29 +0000	[thread overview]
Message-ID: <bug-81159-4-lkOTEv6mOL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-81159-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2022-08-26 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-81159-4-lkOTEv6mOL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).