[PATCH] D73441: [clang-tidy] Fix bugprone-use-after-move when move is in noexcept operator

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 26 23:27:16 PST 2020


gribozavr2 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp:387
+               unless(inDecltypeOrTemplateArg()),
+               unless(hasAncestor(cxxNoexceptExpr())))
           .bind("call-move");
----------------
Quuxplusone wrote:
> What about `sizeof`, `alignof`, `requires`, `typeid`, and other such unevaluated contexts? Shouldn't there be a common way to spell "this expression is unevaluated"? (I don't know if there is or not.)
+1 to adding handling and tests for other unevaluated contexts.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-use-after-move.cpp:1276
+namespace PR44667 {
+#define REQUIRE(expr) (void)(expr);
+struct S {};
----------------
Is the macro a necessary part of this test? If not, can it be removed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73441





More information about the cfe-commits mailing list