summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2017-08-02 13:13:11 +0000
committerManuel Klimek <klimek@google.com>2017-08-02 13:13:11 +0000
commit7b9c117b82eb6b7facfb2406d582e6d08f4ff424 (patch)
tree8d17f5ec9f3de5c55591d1eb32aff893ed5076f7 /clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp
parent696e505278663ef76f996fa5c196ba01e2904be2 (diff)
downloadbcm5719-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.cpp20
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 =
OpenPOWER on IntegriCloud