[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 15 08:00:54 PDT 2020


aaron.ballman added reviewers: lebedev.ri, JonasToth, ldionne.
aaron.ballman added a comment.
Herald added a subscriber: dexonsmith.

In D74692#1923315 <https://reviews.llvm.org/D74692#1923315>, @zinovy.nis wrote:

> In D74692#1923191 <https://reviews.llvm.org/D74692#1923191>, @Quuxplusone wrote:
>
> > I still think this entire patch is misguided; there's no reason to make the note for `const std::string s; std::move(s)` any longer than the note for `int i; std::move(i)` or `volatile std::string v; std::move(v)`. People should not be using moved-from objects, period; and those who want to use moved-from objects, should not enable this clang-tidy check.
> >
> > However, I have no further comments //besides// philosophical opposition to the whole idea.
>
>
> By this patch I'd like to provide more helpful info to the user on why the code is wrong.
>  Anyway I don't like to submit this patch if you still have such strong objections.


I don't feel strongly in favor of this patch, but I also am not strongly opposed to it. I've added some more reviewers to see if there are other opinions on the matter.


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

https://reviews.llvm.org/D74692





More information about the cfe-commits mailing list