summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
index 70819951c3f..a3b4515361f 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
@@ -80,6 +80,11 @@ namespace readability {
void RedundantStringCStrCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
+ // Only register the matchers for C++; the functionality currently does not
+ // provide any benefit to other languages, despite being benign.
+ if (!getLangOpts().CPlusPlus)
+ return;
+
Finder->addMatcher(
constructExpr(
hasDeclaration(methodDecl(hasName(StringConstructor))),
OpenPOWER on IntegriCloud