PiotrZSL added inline comments.
================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp:1296 +// In a function call, the expression that determines the callee is sequenced +// before the arguments. ---------------- This entire file tests only C++17 and later, when std::move is C++11 feature. Add separate test file for C++11 (or even better split this one between C++11 and C++17) Scenario to test in C++11, should warn ? ``` a->foo(std::move(a)); ``` ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp:1304 + std::unique_ptr<A> a; + a->foo(std::move(a)); +} ---------------- What about scenario like this: ``` b.foo(a->saveBIntoAAndReturnBool(std::move(b))); ``` Is first "b" still guaranteed to be alive after std::move ? ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp:1305 + a->foo(std::move(a)); +} +} // namespace CalleeSequencedBeforeArguments ---------------- I didn't found any test for correct warning in this case: ``` std::unique_ptr<A> getArg(std::unique_ptr<A>); getArg(std::move(a))->foo(std::move(a)); ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145581/new/ https://reviews.llvm.org/D145581 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits