clang-tools  3.9.0
BoolPointerImplicitConversionCheck.h
Go to the documentation of this file.
1 //===--- BoolPointerImplicitConversionCheck.h - clang-tidy ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_BOOLPOINTERIMPLICITCONVERSIONCHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_BOOLPOINTERIMPLICITCONVERSIONCHECK_H
12 
13 #include "../ClangTidy.h"
14 
15 namespace clang {
16 namespace tidy {
17 namespace misc {
18 
19 /// Checks for conditions based on implicit conversion from a bool pointer to
20 /// bool.
21 ///
22 /// Example:
23 ///
24 /// \code
25 /// bool *p;
26 /// if (p) {
27 /// // Never used in a pointer-specific way.
28 /// }
29 /// \endcode
31 public:
33  : ClangTidyCheck(Name, Context) {}
34  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
35  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
36 };
37 
38 } // namespace misc
39 } // namespace tidy
40 } // namespace clang
41 
42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_BOOLPOINTERIMPLICITCONVERSIONCHECK_H
43 
const std::string Name
Definition: USRFinder.cpp:140
Checks for conditions based on implicit conversion from a bool pointer to bool.
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:210
Base class for all clang-tidy checks.
Definition: ClangTidy.h:110
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
BoolPointerImplicitConversionCheck(StringRef Name, ClangTidyContext *Context)
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
const NamedDecl * Result
Definition: USRFinder.cpp:137