clang-tools 22.0.0git
clang::tidy::bugprone::IncorrectEnableSharedFromThisCheck Class Reference

Detect classes or structs that do not publicly inherit from std::enable_shared_from_this, because unintended behavior will / otherwise occur when calling shared_from_this. More...

#include <IncorrectEnableSharedFromThisCheck.h>

Inheritance diagram for clang::tidy::bugprone::IncorrectEnableSharedFromThisCheck:
[legend]

Public Member Functions

 IncorrectEnableSharedFromThisCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override

Detailed Description

Detect classes or structs that do not publicly inherit from std::enable_shared_from_this, because unintended behavior will / otherwise occur when calling shared_from_this.

For the user-facing documentation see:
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/incorrect-enable-shared-from-this.html 

Definition at line 22 of file IncorrectEnableSharedFromThisCheck.h.

Constructor & Destructor Documentation

◆ IncorrectEnableSharedFromThisCheck()

clang::tidy::bugprone::IncorrectEnableSharedFromThisCheck::IncorrectEnableSharedFromThisCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file IncorrectEnableSharedFromThisCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::bugprone::IncorrectEnableSharedFromThisCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 37 of file IncorrectEnableSharedFromThisCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::bugprone::IncorrectEnableSharedFromThisCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 28 of file IncorrectEnableSharedFromThisCheck.h.

◆ registerMatchers()

void clang::tidy::bugprone::IncorrectEnableSharedFromThisCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 18 of file IncorrectEnableSharedFromThisCheck.cpp.


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