summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-09-02 16:20:42 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-09-02 16:20:42 +0000
commitec3e5d6fd87862eb77a2b0320d79b9a4427d39df (patch)
treec3a7c289cc09bb18ebae6bd2e84c98d5a1708b3f /clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
parentfb497d79f65cfb9003f5494e5dea39753cb776c5 (diff)
downloadbcm5719-llvm-ec3e5d6fd87862eb77a2b0320d79b9a4427d39df.tar.gz
bcm5719-llvm-ec3e5d6fd87862eb77a2b0320d79b9a4427d39df.zip
Disable clang-tidy Google checkers when not compiling in C++ mode. None of the checkers require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct.
llvm-svn: 246663
Diffstat (limited to 'clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
index 8358cb2e5e6..d419a01de08 100644
--- a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
@@ -21,8 +21,11 @@ namespace build {
void UnnamedNamespaceInHeaderCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
- Finder->addMatcher(namespaceDecl(isAnonymous()).bind("anonymousNamespace"),
- this);
+ // Only register the matchers for C++; the functionality currently does not
+ // provide any benefit to other languages, despite being benign.
+ if (getLangOpts().CPlusPlus)
+ Finder->addMatcher(namespaceDecl(isAnonymous()).bind("anonymousNamespace"),
+ this);
}
void
OpenPOWER on IntegriCloud