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
- Build Status
- Buildable 961 - Build 961: arc lint + arc unit 
Event Timeline
| clang-tidy/misc/UseAfterMoveCheck.cpp | ||
|---|---|---|
| 467 | 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 | Shouldn't this improvement also include weak_ptr? | |
| 540 | And ::std::weak_ptr? | |
Comment Actions
LG modulo comments.
| clang-tidy/misc/UseAfterMoveCheck.cpp | ||
|---|---|---|
| 496 | Use ArrayRef instead of const SmallVectorImpl<> &. | |
This logic could be improved as:
However, I'm not certain that this function is needed at all -- it's pretty simple and is only used from isStandardSmartPointer().