This revision was automatically updated to reflect the committed changes.
mboehme marked 2 inline comments as done.
Closed by commit rL285842: [clang-tidy] Extend misc-use-after-move to support
unique_ptr and shared_ptr. (authored by mboehme).
Changed prior to commit:
aaron.ballman accepted this revision.
aaron.ballman added a comment.
LGTM, thank you!
https://reviews.llvm.org/D26041
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mboehme marked 4 inline comments as done.
mboehme added a comment.
Please take another look.
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:467
+StringRef getName(const NamedDecl *ND) {
+ if (!ND->getIdentifier())
+return StringRef();
aaron.ballman
mboehme updated this revision to Diff 76655.
mboehme added a comment.
- Responses to reviewer comments
https://reviews.llvm.org/D26041
Files:
clang-tidy/misc/UseAfterMoveCheck.cpp
docs/clang-tidy/checks/misc-use-after-move.rst
test/clang-tidy/misc-use-after-move.cpp
Index:
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
LG modulo comments.
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:498
+auto addDeclRefs = [this, Block,
+DeclRefs](const SmallVectorImpl ) {
aaron.ballman added inline comments.
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:467
+StringRef getName(const NamedDecl *ND) {
+ if (!ND->getIdentifier())
+return StringRef();
This logic could be improved as:
```
if (const auto *ID =
mboehme created this revision.
mboehme added a reviewer: alexfh.
mboehme added a subscriber: cfe-commits.
As a unique_ptr or shared_ptr that has been moved from is guaranteed to be null,
we only warn if the pointer is dereferenced.
https://reviews.llvm.org/D26041
Files: