diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-08-03 22:02:08 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-08-03 22:02:08 +0000 |
commit | 2644cae3d5708149df916ac60073d28dea87880e (patch) | |
tree | bcd67f29c46a72dc494d298d0a52a1e1ca2b28e9 /clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp | |
parent | 95dd3cb0919b180e83b94a66cc5998ef3ff45d24 (diff) | |
download | bcm5719-llvm-2644cae3d5708149df916ac60073d28dea87880e.tar.gz bcm5719-llvm-2644cae3d5708149df916ac60073d28dea87880e.zip |
[clang-tidy] Improve the misc-unused-alias-decl message
"this namespace alias decl is unused" -> "namespace alias decl '...' is unused"
llvm-svn: 243906
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp index 0b596922341..80e48611ed1 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -30,7 +30,7 @@ void UnusedAliasDeclsCheck::registerMatchers(MatchFinder *Finder) { } void UnusedAliasDeclsCheck::check(const MatchFinder::MatchResult &Result) { - if (const auto *AliasDecl = Result.Nodes.getNodeAs<Decl>("alias")) { + if (const auto *AliasDecl = Result.Nodes.getNodeAs<NamedDecl>("alias")) { FoundDecls[AliasDecl] = CharSourceRange::getCharRange( AliasDecl->getLocStart(), Lexer::findLocationAfterToken( @@ -52,7 +52,8 @@ void UnusedAliasDeclsCheck::onEndOfTranslationUnit() { for (const auto &FoundDecl : FoundDecls) { if (!FoundDecl.second.isValid()) continue; - diag(FoundDecl.first->getLocation(), "this namespace alias decl is unused") + diag(FoundDecl.first->getLocation(), "namespace alias decl '%0' is unused") + << FoundDecl.first->getName() << FixItHint::CreateRemoval(FoundDecl.second); } } |