diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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, |