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"
26 AllowConditionalIntegerCasts(
27 Options.get(
"AllowConditionalIntegerCasts", 0) != 0),
28 AllowConditionalPointerCasts(
29 Options.get(
"AllowConditionalPointerCasts", 0) != 0) {}
31 void check(
const ast_matchers::MatchFinder::MatchResult &
Result)
override;
34 void handleCastToBool(
const ImplicitCastExpr *CastExpression,
35 const Stmt *ParentStatement, ASTContext &Context);
36 void handleCastFromBool(
const ImplicitCastExpr *CastExpression,
37 const ImplicitCastExpr *FurtherImplicitCastExpression,
40 bool AllowConditionalIntegerCasts;
41 bool AllowConditionalPointerCasts;
47 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CAST_H
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
std::unique_ptr< ast_matchers::MatchFinder > Finder
Base class for all clang-tidy checks.
Checks for use of implicit bool casts in expressions.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register ASTMatchers with Finder.
ImplicitBoolCastCheck(StringRef Name, ClangTidyContext *Context)
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.