blob: 83d99fa141160d76d9b5ea75fe8c63d3e7356821 [file] [log] [blame]
Alexander Kornienko276fc642014-06-29 22:19:53 +00001//===--- 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 Kornienko66580552015-03-09 16:52:33 +000010#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H
11#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H
Alexander Kornienko276fc642014-06-29 22:19:53 +000012
13#include "../ClangTidy.h"
14
15namespace clang {
16namespace tidy {
Alexander Kornienkoed824e02015-03-05 13:46:14 +000017namespace google {
Alexander Kornienko276fc642014-06-29 22:19:53 +000018namespace 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 Kornienkoe3b78392014-06-30 09:54:12 +000024///
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 Kornienko276fc642014-06-29 22:19:53 +000028class AvoidCStyleCastsCheck : public ClangTidyCheck {
29public:
Alexander Kornienko6e0cbc82014-09-12 08:53:36 +000030 AvoidCStyleCastsCheck(StringRef Name, ClangTidyContext *Context)
31 : ClangTidyCheck(Name, Context) {}
Alexander Kornienko276fc642014-06-29 22:19:53 +000032 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
33 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
34};
35
36} // namespace readability
Alexander Kornienkoed824e02015-03-05 13:46:14 +000037} // namespace google
Alexander Kornienko276fc642014-06-29 22:19:53 +000038} // namespace tidy
39} // namespace clang
40
Alexander Kornienko66580552015-03-09 16:52:33 +000041#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H