9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_USING_DECLS_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_USING_DECLS_H
12#include "../ClangTidyCheck.h"
13#include "../utils/FileExtensionsUtils.h"
14#include "llvm/ADT/SmallPtrSet.h"
27 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
30 return LangOpts.CPlusPlus;
34 void removeFromFoundDecls(
const Decl *D);
36 struct UsingDeclContext {
37 explicit UsingDeclContext(
const UsingDecl *FoundUsingDecl)
38 : FoundUsingDecl(FoundUsingDecl) {}
42 llvm::SmallPtrSet<const Decl *, 4> UsingTargetDecls;
44 const UsingDecl *FoundUsingDecl;
46 CharSourceRange UsingDeclRange;
51 std::vector<UsingDeclContext> Contexts;
52 llvm::SmallPtrSet<const Decl *, 32> UsingTargetDeclsCache;
54 StringRef RawStringHeaderFileExtensions;
const FunctionDecl * Decl
llvm::SmallString< 256U > Name
Base class for all clang-tidy checks.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Finds unused using declarations.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Override this to disable registering matchers and PP callbacks if an invalid language version is bein...
void onEndOfTranslationUnit() override
llvm::SmallSet< llvm::StringRef, 5 > FileExtensionsSet