clang-tools 22.0.0git
clang::tidy::readability::RedundantSmartptrGetCheck Class Reference

Find and remove redundant calls to smart pointer's .get() method. More...

#include <RedundantSmartptrGetCheck.h>

Inheritance diagram for clang::tidy::readability::RedundantSmartptrGetCheck:
[legend]

Public Member Functions

 RedundantSmartptrGetCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Find and remove redundant calls to smart pointer's .get() method.

Examples:

ptr.get()->Foo() ==> ptr->Foo()
*ptr.get() ==> *ptr
*ptr->get() ==> **ptr

Definition at line 25 of file RedundantSmartptrGetCheck.h.

Constructor & Destructor Documentation

◆ RedundantSmartptrGetCheck()

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

Definition at line 27 of file RedundantSmartptrGetCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::readability::RedundantSmartptrGetCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 151 of file RedundantSmartptrGetCheck.cpp.

◆ getCheckTraversalKind()

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

Definition at line 36 of file RedundantSmartptrGetCheck.h.

◆ isLanguageVersionSupported()

bool clang::tidy::readability::RedundantSmartptrGetCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 30 of file RedundantSmartptrGetCheck.h.

◆ registerMatchers()

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

Definition at line 128 of file RedundantSmartptrGetCheck.cpp.

◆ storeOptions()

void clang::tidy::readability::RedundantSmartptrGetCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 123 of file RedundantSmartptrGetCheck.cpp.


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