From 1f1b067036a0cdde17d11d92cf45320c63683a43 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 2 Sep 2015 16:05:21 +0000 Subject: Disable clang-tidy readability 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: 246661 --- clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp') diff --git a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp index ba3b837cbd6..8a13b5ba239 100644 --- a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp @@ -34,7 +34,10 @@ void NamespaceCommentCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { } void NamespaceCommentCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher(namespaceDecl().bind("namespace"), 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(namespaceDecl().bind("namespace"), this); } static bool locationsInSameFile(const SourceManager &Sources, -- cgit v1.2.3