diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp index ffa0873fb14..3af988a647a 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -20,13 +20,14 @@ namespace tidy { void UnusedAliasDeclsCheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++11; the functionality currently does not // provide any benefit to other languages, despite being benign. - if (getLangOpts().CPlusPlus11) { - // We cannot do anything about headers (yet), as the alias declarations - // used in one header could be used by some other translation unit. - Finder->addMatcher( - namespaceAliasDecl(isExpansionInMainFile()).bind("alias"), this); - Finder->addMatcher(nestedNameSpecifier().bind("nns"), this); - } + if (!getLangOpts().CPlusPlus11) + return; + + // We cannot do anything about headers (yet), as the alias declarations + // used in one header could be used by some other translation unit. + Finder->addMatcher(namespaceAliasDecl(isExpansionInMainFile()).bind("alias"), + this); + Finder->addMatcher(nestedNameSpecifier().bind("nns"), this); } void UnusedAliasDeclsCheck::check(const MatchFinder::MatchResult &Result) { |