clang-tools 22.0.0git
clang::tidy::cppcoreguidelines::OwningMemoryCheck Class Reference

Checks for common use cases for gsl::owner and enforces the unique owner nature of it whenever possible. More...

#include <OwningMemoryCheck.h>

Inheritance diagram for clang::tidy::cppcoreguidelines::OwningMemoryCheck:
[legend]

Public Member Functions

 OwningMemoryCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
 Make configuration of checker discoverable.
void registerMatchers (ast_matchers::MatchFinder *Finder) override
 Match common cases, where the owner semantic is relevant, like function calls, delete expressions and others.
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Checks for common use cases for gsl::owner and enforces the unique owner nature of it whenever possible.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/owning-memory.html

Definition at line 21 of file OwningMemoryCheck.h.

Constructor & Destructor Documentation

◆ OwningMemoryCheck()

clang::tidy::cppcoreguidelines::OwningMemoryCheck::OwningMemoryCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 23 of file OwningMemoryCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::cppcoreguidelines::OwningMemoryCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 216 of file OwningMemoryCheck.cpp.

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::cppcoreguidelines::OwningMemoryCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 40 of file OwningMemoryCheck.h.

◆ isLanguageVersionSupported()

bool clang::tidy::cppcoreguidelines::OwningMemoryCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 31 of file OwningMemoryCheck.h.

◆ registerMatchers()

void clang::tidy::cppcoreguidelines::OwningMemoryCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Match common cases, where the owner semantic is relevant, like function calls, delete expressions and others.

Definition at line 38 of file OwningMemoryCheck.cpp.

References clang::tidy::utils::options::parseStringList().

◆ storeOptions()

void clang::tidy::cppcoreguidelines::OwningMemoryCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Make configuration of checker discoverable.

Definition at line 31 of file OwningMemoryCheck.cpp.


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