Benjamin Kramer | 1c8b317 | 2014-07-11 08:08:47 +0000 | [diff] [blame] | 1 | //===--- BoolPointerImplicitConversion.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_BOOL_POINTER_IMPLICIT_CONV_H |
| 11 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_BOOL_POINTER_IMPLICIT_CONV_H |
| 12 | |
| 13 | #include "../ClangTidy.h" |
| 14 | |
| 15 | namespace clang { |
| 16 | namespace tidy { |
| 17 | |
| 18 | /// \brief Checks for conditions based on implicit conversion from a bool |
| 19 | /// pointer to bool e.g. |
| 20 | /// bool *p; |
| 21 | /// if (p) { |
| 22 | /// // Never used in a pointer-specific way. |
| 23 | /// } |
| 24 | class BoolPointerImplicitConversion : public ClangTidyCheck { |
| 25 | public: |
Alexander Kornienko | 6e0cbc8 | 2014-09-12 08:53:36 +0000 | [diff] [blame^] | 26 | BoolPointerImplicitConversion(StringRef Name, ClangTidyContext *Context) |
| 27 | : ClangTidyCheck(Name, Context) {} |
Benjamin Kramer | 1c8b317 | 2014-07-11 08:08:47 +0000 | [diff] [blame] | 28 | void registerMatchers(ast_matchers::MatchFinder *Finder) override; |
| 29 | void check(const ast_matchers::MatchFinder::MatchResult &Result) override; |
| 30 | }; |
| 31 | |
| 32 | } // namespace tidy |
| 33 | } // namespace clang |
| 34 | |
| 35 | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_BOOL_POINTER_IMPLICIT_CONV_H |
| 36 | |