[PATCH] D67292: [clang-tidy] Fix bug in bugprone-use-after-move check

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 11:37:26 PDT 2019


gribozavr accepted this revision.
gribozavr added a comment.
This revision is now accepted and ready to land.

Thanks for the quick fix!



================
Comment at: clang-tools-extra/test/clang-tidy/bugprone-use-after-move.cpp:1198
+    }
+  }
   for (int i = 0; i < 10; ++i) {
----------------
Unless you think it is redundant, could you also add

```
if (A a1; A(std::move(a2)).getInt() > 0) {}
```

Also some true positive tests would be good:

```
if (A a1; A(std::move(a2)).getInt() > A(std::move(a2)).getInt()) {}
```

```
A a1;
if (A a2 = std::move(a1); A(std::move(a1)) > 0) {}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67292





More information about the cfe-commits mailing list