summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp
diff options
context:
space:
mode:
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