summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
index 5d93357e398..b2aff4d1471 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
@@ -30,7 +30,8 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
// than one shadow.
if (Using->shadow_size() != 1)
return;
- const auto* TargetDecl = Using->shadow_begin()->getTargetDecl();
+ const auto *TargetDecl =
+ Using->shadow_begin()->getTargetDecl()->getCanonicalDecl();
// FIXME: Handle other target types.
if (!isa<RecordDecl>(TargetDecl))
@@ -52,8 +53,9 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
// FIXME: This currently doesn't look at whether the type reference is
// actually found with the help of the using declaration.
if (const auto *Used = Result.Nodes.getNodeAs<NamedDecl>("used")) {
- if (FoundDecls.find(Used) != FoundDecls.end())
- FoundDecls[Used] = nullptr;
+ auto I = FoundDecls.find(Used->getCanonicalDecl());
+ if (I != FoundDecls.end())
+ I->second = nullptr;
}
}
OpenPOWER on IntegriCloud