[PATCH] D126853: [clang-tidy] `bugprone-use-after-move`: Don't warn on self-moves.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 02:03:36 PDT 2022


mboehme added a comment.

The reviewer on https://reviews.llvm.org/D126780 reminded me to add release notes, so I've done so here as well. I assume this does not require another round of review.

In D126853#3556029 <https://reviews.llvm.org/D126853#3556029>, @njames93 wrote:

> LGTM.
>
> I feel that this case should produce a warning akin to the no self assignment diagnostics, obviously nothing to do with this check though.

Makes sense -- acknowledged.

FWIW, the use case that prompted me to make this change was a test for the move assignment operator where clang-tidy was erroneously flagging the self-move as a use-after-move. Self-moves shouldn't occur outside of test code though, and it would be good to have some check produce a warning for them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126853/new/

https://reviews.llvm.org/D126853



More information about the cfe-commits mailing list