Disable clang-tidy misc checkers when not compiling in C++ mode. Many of the checkers do not 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: 246318
diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
index 7bc7835..155baf8 100644
--- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
@@ -17,11 +17,15 @@
namespace tidy {
void NoexceptMoveConstructorCheck::registerMatchers(MatchFinder *Finder) {
- Finder->addMatcher(
- methodDecl(anyOf(constructorDecl(), hasOverloadedOperatorName("=")),
- unless(isImplicit()), unless(isDeleted()))
- .bind("decl"),
- this);
+ // Only register the matchers for C++11; the functionality currently does not
+ // provide any benefit to other languages, despite being benign.
+ if (getLangOpts().CPlusPlus11) {
+ Finder->addMatcher(
+ methodDecl(anyOf(constructorDecl(), hasOverloadedOperatorName("=")),
+ unless(isImplicit()), unless(isDeleted()))
+ .bind("decl"),
+ this);
+ }
}
void NoexceptMoveConstructorCheck::check(