diff options
| author | Martin Bohme <mboehme@google.com> | 2019-01-16 07:53:25 +0000 |
|---|---|---|
| committer | Martin Bohme <mboehme@google.com> | 2019-01-16 07:53:25 +0000 |
| commit | c4db59c63cd1c242470de8ad69c3343462ccc798 (patch) | |
| tree | 5a48dc9e549c6bbca3394731e1234873bd7252d6 /clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp | |
| parent | cfa2a2afa64890858999ab9510627712c0f5e4f9 (diff) | |
| download | bcm5719-llvm-c4db59c63cd1c242470de8ad69c3343462ccc798.tar.gz bcm5719-llvm-c4db59c63cd1c242470de8ad69c3343462ccc798.zip | |
[clang-tidy] Treat references to smart pointers correctly in use-after-move.
Summary:
Previously, we weren't recognizing these as smart pointers and thus
weren't allowing non-dereference accesses as we should -- see new test
cases which fail without the fix.
Reviewers: alexfh, hokein, aaron.ballman, JonasToth
Reviewed By: JonasToth
Subscribers: xazax.hun, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D56585
llvm-svn: 351303
Diffstat (limited to 'clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp index 11799ebf6d2..99c847ebc46 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp @@ -207,7 +207,7 @@ void UseAfterMoveFinder::getUsesAndReinits( } bool isStandardSmartPointer(const ValueDecl *VD) { - const Type *TheType = VD->getType().getTypePtrOrNull(); + const Type *TheType = VD->getType().getNonReferenceType().getTypePtrOrNull(); if (!TheType) return false; |

