diff options
author | Manuel Klimek <klimek@google.com> | 2017-08-02 13:13:11 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2017-08-02 13:13:11 +0000 |
commit | 7b9c117b82eb6b7facfb2406d582e6d08f4ff424 (patch) | |
tree | 8d17f5ec9f3de5c55591d1eb32aff893ed5076f7 /clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp | |
parent | 696e505278663ef76f996fa5c196ba01e2904be2 (diff) | |
download | bcm5719-llvm-7b9c117b82eb6b7facfb2406d582e6d08f4ff424.tar.gz bcm5719-llvm-7b9c117b82eb6b7facfb2406d582e6d08f4ff424.zip |
Adapt clang-tidy checks to changing semantics of hasDeclaration.
Differential Revision: https://reviews.llvm.org/D36154
llvm-svn: 309810
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp b/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp index 842aa5b3f72..99673766a53 100644 --- a/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp @@ -271,15 +271,17 @@ void UseAfterMoveFinder::getReinits( auto DeclRefMatcher = declRefExpr(hasDeclaration(equalsNode(MovedVariable))).bind("declref"); - auto StandardContainerTypeMatcher = hasType(cxxRecordDecl( - hasAnyName("::std::basic_string", "::std::vector", "::std::deque", - "::std::forward_list", "::std::list", "::std::set", - "::std::map", "::std::multiset", "::std::multimap", - "::std::unordered_set", "::std::unordered_map", - "::std::unordered_multiset", "::std::unordered_multimap"))); - - auto StandardSmartPointerTypeMatcher = hasType(cxxRecordDecl( - hasAnyName("::std::unique_ptr", "::std::shared_ptr", "::std::weak_ptr"))); + auto StandardContainerTypeMatcher = hasType(hasUnqualifiedDesugaredType( + recordType(hasDeclaration(cxxRecordDecl(hasAnyName( + "::std::basic_string", "::std::vector", "::std::deque", + "::std::forward_list", "::std::list", "::std::set", "::std::map", + "::std::multiset", "::std::multimap", "::std::unordered_set", + "::std::unordered_map", "::std::unordered_multiset", + "::std::unordered_multimap")))))); + + auto StandardSmartPointerTypeMatcher = hasType(hasUnqualifiedDesugaredType( + recordType(hasDeclaration(cxxRecordDecl(hasAnyName( + "::std::unique_ptr", "::std::shared_ptr", "::std::weak_ptr")))))); // Matches different types of reinitialization. auto ReinitMatcher = |