clang-tools 22.0.0git
clang::tidy::google::readability::AvoidCStyleCastsCheck Class Reference

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

#include <AvoidCStyleCastsCheck.h>

Inheritance diagram for clang::tidy::google::readability::AvoidCStyleCastsCheck:
[legend]

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

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/google/readability-casting.html

Definition at line 28 of file AvoidCStyleCastsCheck.h.

Constructor & Destructor Documentation

◆ AvoidCStyleCastsCheck()

clang::tidy::google::readability::AvoidCStyleCastsCheck::AvoidCStyleCastsCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 30 of file AvoidCStyleCastsCheck.h.

Member Function Documentation

◆ check()

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::google::readability::AvoidCStyleCastsCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 34 of file AvoidCStyleCastsCheck.h.

◆ registerMatchers()

void clang::tidy::google::readability::AvoidCStyleCastsCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 19 of file AvoidCStyleCastsCheck.cpp.


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