summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.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/ExplicitConstructorCheck.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/ExplicitConstructorCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
index 9552e1afa34..22e2139fbd4 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
@@ -20,8 +20,11 @@ namespace tidy {
namespace google {
void ExplicitConstructorCheck::registerMatchers(MatchFinder *Finder) {
- Finder->addMatcher(constructorDecl(unless(isInstantiated())).bind("ctor"),
- 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(constructorDecl(unless(isInstantiated())).bind("ctor"),
+ this);
}
// Looks for the token matching the predicate and returns the range of the found
OpenPOWER on IntegriCloud