File indexing completed on 2026-05-10 08:36:20
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REDUNDANT_VOID_ARG_CHECK_H
0010 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REDUNDANT_VOID_ARG_CHECK_H
0011
0012 #include "../ClangTidyCheck.h"
0013 #include "clang/Lex/Token.h"
0014
0015 #include <string>
0016
0017 namespace clang::tidy::modernize {
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 class RedundantVoidArgCheck : public ClangTidyCheck {
0030 public:
0031 RedundantVoidArgCheck(StringRef Name, ClangTidyContext *Context)
0032 : ClangTidyCheck(Name, Context) {}
0033
0034 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
0035 return LangOpts.CPlusPlus;
0036 }
0037
0038 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
0039
0040 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
0041
0042 private:
0043 void processFunctionDecl(const ast_matchers::MatchFinder::MatchResult &Result,
0044 const FunctionDecl *Function);
0045
0046 void
0047 processTypedefNameDecl(const ast_matchers::MatchFinder::MatchResult &Result,
0048 const TypedefNameDecl *Typedef);
0049
0050 void processFieldDecl(const ast_matchers::MatchFinder::MatchResult &Result,
0051 const FieldDecl *Member);
0052
0053 void processVarDecl(const ast_matchers::MatchFinder::MatchResult &Result,
0054 const VarDecl *Var);
0055
0056 void
0057 processNamedCastExpr(const ast_matchers::MatchFinder::MatchResult &Result,
0058 const CXXNamedCastExpr *NamedCast);
0059
0060 void
0061 processExplicitCastExpr(const ast_matchers::MatchFinder::MatchResult &Result,
0062 const ExplicitCastExpr *ExplicitCast);
0063
0064 void processLambdaExpr(const ast_matchers::MatchFinder::MatchResult &Result,
0065 const LambdaExpr *Lambda);
0066
0067 void
0068 removeVoidArgumentTokens(const ast_matchers::MatchFinder::MatchResult &Result,
0069 SourceRange Range, StringRef GrammarLocation);
0070
0071 void removeVoidToken(Token VoidToken, StringRef Diagnostic);
0072 };
0073
0074 }
0075
0076 #endif