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.
Details
Details
- Reviewers
aaron.ballman hokein alexfh - Commits
- rG5d9d417a082b: [clang-tidy] Extend misc-use-after-move to support unique_ptr and shared_ptr.
rCTE285842: [clang-tidy] Extend misc-use-after-move to support unique_ptr and shared_ptr.
rL285842: [clang-tidy] Extend misc-use-after-move to support unique_ptr and shared_ptr.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tidy/misc/UseAfterMoveCheck.cpp | ||
---|---|---|
467 ↗ | (On Diff #76081) | This logic could be improved as: if (const auto *ID = ND->getIdentifier()) return ID->getName(); return ""; However, I'm not certain that this function is needed at all -- it's pretty simple and is only used from isStandardSmartPointer(). |
482 ↗ | (On Diff #76081) | Shouldn't this improvement also include weak_ptr? |
542 ↗ | (On Diff #76081) | And ::std::weak_ptr? |
Comment Actions
LG modulo comments.
clang-tidy/misc/UseAfterMoveCheck.cpp | ||
---|---|---|
498 ↗ | (On Diff #76081) | Use ArrayRef instead of const SmallVectorImpl<> &. |