[clang-tools-extra] a0ae525 - [clang-tidy]unused using decls only check cpp files (#77335)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 8 16:02:15 PST 2024
Author: Congcong Cai
Date: 2024-01-09T08:01:57+08:00
New Revision: a0ae5258065a856d5f8d9f8dcb12e9d8394f789f
URL: https://github.com/llvm/llvm-project/commit/a0ae5258065a856d5f8d9f8dcb12e9d8394f789f
DIFF: https://github.com/llvm/llvm-project/commit/a0ae5258065a856d5f8d9f8dcb12e9d8394f789f.diff
LOG: [clang-tidy]unused using decls only check cpp files (#77335)
Added:
Modified:
clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h
clang-tools-extra/docs/ReleaseNotes.rst
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h
index fa2a8799d098c3..498b3ffd2678c3 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h
@@ -26,6 +26,9 @@ class UnusedUsingDeclsCheck : public ClangTidyCheck {
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
void onEndOfTranslationUnit() override;
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
private:
void removeFromFoundDecls(const Decl *D);
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 1bd5a72126c10b..d7f46cede0370c 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -382,7 +382,7 @@ Changes in existing checks
- Improved :doc:`misc-unused-using-decls
<clang-tidy/checks/misc/unused-using-decls>` check to avoid false positive when
- using in elaborated type.
+ using in elaborated type and only check cpp files.
- Improved :doc:`modernize-avoid-bind
<clang-tidy/checks/modernize/avoid-bind>` check to
More information about the cfe-commits
mailing list