10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CAST_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CAST_H
13 #include "../ClangTidy.h"
17 namespace readability {
27 AllowConditionalIntegerCasts(
28 Options.get(
"AllowConditionalIntegerCasts", 0) != 0),
29 AllowConditionalPointerCasts(
30 Options.get(
"AllowConditionalPointerCasts", 0) != 0) {}
32 void check(
const ast_matchers::MatchFinder::MatchResult &
Result)
override;
35 void handleCastToBool(
const ImplicitCastExpr *CastExpression,
36 const Stmt *ParentStatement, ASTContext &Context);
37 void handleCastFromBool(
const ImplicitCastExpr *CastExpression,
38 const ImplicitCastExpr *FurtherImplicitCastExpression,
41 bool AllowConditionalIntegerCasts;
42 bool AllowConditionalPointerCasts;
49 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CAST_H
std::unique_ptr< ast_matchers::MatchFinder > Finder
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Base class for all clang-tidy checks.
ImplicitBoolCastCheck(StringRef Name, ClangTidyContext *Context)
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Checks for use of implicit bool casts in expressions.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.