From 327e97bb37ec535f134b0b3e7ecbb9c181ad4f4c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 28 Aug 2015 19:27:19 +0000 Subject: 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 --- .../clang-tidy/misc/NoexceptMoveConstructorCheck.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp') diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp index 7bc7835efcb..155baf84ee9 100644 --- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp @@ -17,11 +17,15 @@ namespace clang { 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( -- cgit v1.2.3