clang-tools 23.0.0git
clang::tidy::cppcoreguidelines::AvoidCapturingLambdaCoroutinesCheck Class Reference

Flags C++20 coroutine lambdas with non-empty capture lists that may cause use-after-free errors and suggests avoiding captures or ensuring the lambda closure object has a guaranteed lifetime. More...

#include <AvoidCapturingLambdaCoroutinesCheck.h>

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

Public Member Functions

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

Detailed Description

Flags C++20 coroutine lambdas with non-empty capture lists that may cause use-after-free errors and suggests avoiding captures or ensuring the lambda closure object has a guaranteed lifetime.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-capturing-lambda-coroutines.html

Definition at line 22 of file AvoidCapturingLambdaCoroutinesCheck.h.

Constructor & Destructor Documentation

◆ AvoidCapturingLambdaCoroutinesCheck()

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

Definition at line 30 of file AvoidCapturingLambdaCoroutinesCheck.cpp.

Member Function Documentation

◆ check()

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

Definition at line 60 of file AvoidCapturingLambdaCoroutinesCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::cppcoreguidelines::AvoidCapturingLambdaCoroutinesCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
override

Definition at line 49 of file AvoidCapturingLambdaCoroutinesCheck.cpp.

◆ registerMatchers()

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

Definition at line 36 of file AvoidCapturingLambdaCoroutinesCheck.cpp.

◆ storeOptions()

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

Definition at line 54 of file AvoidCapturingLambdaCoroutinesCheck.cpp.


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