clang-tools 22.0.0git
clang::tidy::modernize::AvoidCStyleCastCheck Class Reference

Finds usages of C-style casts. More...

#include <AvoidCStyleCastCheck.h>

Inheritance diagram for clang::tidy::modernize::AvoidCStyleCastCheck:
[legend]

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ AvoidCStyleCastCheck()

clang::tidy::modernize::AvoidCStyleCastCheck::AvoidCStyleCastCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 30 of file AvoidCStyleCastCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::modernize::AvoidCStyleCastCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::modernize::AvoidCStyleCastCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 34 of file AvoidCStyleCastCheck.h.

◆ registerMatchers()

void clang::tidy::modernize::AvoidCStyleCastCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 19 of file AvoidCStyleCastCheck.cpp.


The documentation for this class was generated from the following files: