Skip to content

Commit a0ae525

Browse files
authored
[clang-tidy]unused using decls only check cpp files (#77335)
1 parent ac8b4f8 commit a0ae525

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class UnusedUsingDeclsCheck : public ClangTidyCheck {
2626
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2727
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2828
void onEndOfTranslationUnit() override;
29+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
30+
return LangOpts.CPlusPlus;
31+
}
2932

3033
private:
3134
void removeFromFoundDecls(const Decl *D);

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ Changes in existing checks
382382

383383
- Improved :doc:`misc-unused-using-decls
384384
<clang-tidy/checks/misc/unused-using-decls>` check to avoid false positive when
385-
using in elaborated type.
385+
using in elaborated type and only check cpp files.
386386

387387
- Improved :doc:`modernize-avoid-bind
388388
<clang-tidy/checks/modernize/avoid-bind>` check to

0 commit comments

Comments
 (0)