|
clang-tools 22.0.0git
|
Finds usages of C-style casts. More...
#include <AvoidCStyleCastCheck.h>
Public Member Functions | |
| AvoidCStyleCastCheck (StringRef Name, ClangTidyContext *Context) | |
| void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
| void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
| std::optional< TraversalKind > | getCheckTraversalKind () const override |
Finds usages of C-style casts.
https://google.github.io/styleguide/cppguide.html#Casting
Corresponding cpplint.py check name: 'readability/casting'.
This check is similar to -Wold-style-cast, but it suggests automated fixes in some cases. The reported locations should not be different from the ones generated by -Wold-style-cast.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/modernize/avoid-c-style-cast.html
Definition at line 28 of file AvoidCStyleCastCheck.h.
|
inline |
Definition at line 30 of file AvoidCStyleCastCheck.h.
|
override |
Definition at line 115 of file AvoidCStyleCastCheck.cpp.
References clang::tidy::modernize::getDestTypeString(), clang::tidy::modernize::getReplaceRange(), clang::tidy::modernize::needsConstCast(), clang::tidy::modernize::pointedUnqualifiedTypesAreEqual(), and clang::tidy::modernize::sameTypeAsWritten().
|
inlineoverride |
Definition at line 34 of file AvoidCStyleCastCheck.h.
|
override |
Definition at line 19 of file AvoidCStyleCastCheck.cpp.