Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 1 | //===--- AvoidCStyleCastsCheck.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 | |
Alexander Kornienko | 6658055 | 2015-03-09 16:52:33 +0000 | [diff] [blame^] | 10 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H |
| 11 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H |
Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 12 | |
| 13 | #include "../ClangTidy.h" |
| 14 | |
| 15 | namespace clang { |
| 16 | namespace tidy { |
Alexander Kornienko | ed824e0 | 2015-03-05 13:46:14 +0000 | [diff] [blame] | 17 | namespace google { |
Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 18 | namespace readability { |
| 19 | |
| 20 | /// \brief Finds usages of C-style casts. |
| 21 | /// |
| 22 | /// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Casting#Casting |
| 23 | /// Corresponding cpplint.py check name: 'readability/casting'. |
Alexander Kornienko | e3b7839 | 2014-06-30 09:54:12 +0000 | [diff] [blame] | 24 | /// |
| 25 | /// This check is similar to -Wold-style-cast, but it will suggest automated |
| 26 | /// fixes eventually. The reported locations should not be different from the |
| 27 | /// ones generated by -Wold-style-cast. |
Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 28 | class AvoidCStyleCastsCheck : public ClangTidyCheck { |
| 29 | public: |
Alexander Kornienko | 6e0cbc8 | 2014-09-12 08:53:36 +0000 | [diff] [blame] | 30 | AvoidCStyleCastsCheck(StringRef Name, ClangTidyContext *Context) |
| 31 | : ClangTidyCheck(Name, Context) {} |
Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 32 | void registerMatchers(ast_matchers::MatchFinder *Finder) override; |
| 33 | void check(const ast_matchers::MatchFinder::MatchResult &Result) override; |
| 34 | }; |
| 35 | |
| 36 | } // namespace readability |
Alexander Kornienko | ed824e0 | 2015-03-05 13:46:14 +0000 | [diff] [blame] | 37 | } // namespace google |
Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 38 | } // namespace tidy |
| 39 | } // namespace clang |
| 40 | |
Alexander Kornienko | 6658055 | 2015-03-09 16:52:33 +0000 | [diff] [blame^] | 41 | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H |