clang-tools 22.0.0git
|
Finds usages of C-style casts. More...
#include <AvoidCStyleCastsCheck.h>
Public Member Functions | |
AvoidCStyleCastsCheck (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/google/readability-casting.html
Definition at line 28 of file AvoidCStyleCastsCheck.h.
|
inline |
Definition at line 30 of file AvoidCStyleCastsCheck.h.
|
override |
Definition at line 116 of file AvoidCStyleCastsCheck.cpp.
References clang::tidy::google::readability::getDestTypeString(), clang::tidy::google::readability::getReplaceRange(), clang::tidy::google::readability::needsConstCast(), clang::tidy::google::readability::pointedUnqualifiedTypesAreEqual(), and clang::tidy::google::readability::sameTypeAsWritten().
|
inlineoverride |
Definition at line 34 of file AvoidCStyleCastsCheck.h.
|
override |
Definition at line 19 of file AvoidCStyleCastsCheck.cpp.