diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-09-02 16:20:42 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-09-02 16:20:42 +0000 |
commit | ec3e5d6fd87862eb77a2b0320d79b9a4427d39df (patch) | |
tree | c3a7c289cc09bb18ebae6bd2e84c98d5a1708b3f /clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp | |
parent | fb497d79f65cfb9003f5494e5dea39753cb776c5 (diff) | |
download | bcm5719-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.cpp | 7 |
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 |