clang-tools 22.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
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 )
inline

Definition at line 24 of file AvoidCapturingLambdaCoroutinesCheck.h.

Member Function Documentation

◆ check()

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

Definition at line 37 of file AvoidCapturingLambdaCoroutinesCheck.cpp.

◆ isLanguageVersionSupported()

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

Definition at line 32 of file AvoidCapturingLambdaCoroutinesCheck.cpp.

◆ registerMatchers()

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

Definition at line 26 of file AvoidCapturingLambdaCoroutinesCheck.cpp.


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