summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalcolm Parsons <malcolm.parsons@gmail.com>2016-12-27 22:14:40 +0000
committerMalcolm Parsons <malcolm.parsons@gmail.com>2016-12-27 22:14:40 +0000
commit6057e88c1f54065cdcab22431a148cb731ee5919 (patch)
tree989376707db43e8c97fdd8146ea17ba306fc69dc
parentdcd5649361bf64f70b628c486e20d32a394d19fe (diff)
[clang-tidy] Make 2 checks register matchers for C++ only.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@290633 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--clang-tidy/modernize/UseEqualsDeleteCheck.cpp3
-rw-r--r--clang-tidy/readability/RedundantMemberInitCheck.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/clang-tidy/modernize/UseEqualsDeleteCheck.cpp b/clang-tidy/modernize/UseEqualsDeleteCheck.cpp
index 0ac08014..3c890faa 100644
--- a/clang-tidy/modernize/UseEqualsDeleteCheck.cpp
+++ b/clang-tidy/modernize/UseEqualsDeleteCheck.cpp
@@ -22,6 +22,9 @@ static const char SpecialFunction[] = "SpecialFunction";
static const char DeletedNotPublic[] = "DeletedNotPublic";
void UseEqualsDeleteCheck::registerMatchers(MatchFinder *Finder) {
+ if (!getLangOpts().CPlusPlus)
+ return;
+
auto PrivateSpecialFn = cxxMethodDecl(
isPrivate(),
anyOf(cxxConstructorDecl(anyOf(isDefaultConstructor(),
diff --git a/clang-tidy/readability/RedundantMemberInitCheck.cpp b/clang-tidy/readability/RedundantMemberInitCheck.cpp
index 8fe67c1c..6d365005 100644
--- a/clang-tidy/readability/RedundantMemberInitCheck.cpp
+++ b/clang-tidy/readability/RedundantMemberInitCheck.cpp
@@ -22,6 +22,9 @@ namespace tidy {
namespace readability {
void RedundantMemberInitCheck::registerMatchers(MatchFinder *Finder) {
+ if (!getLangOpts().CPlusPlus)
+ return;
+
auto Construct =
cxxConstructExpr(
hasDeclaration(cxxConstructorDecl(hasParent(