clang 20.0.0git
|
Describes the capture of a variable or of this
, or of a C++1y init-capture.
More...
#include "clang/AST/LambdaCapture.h"
Public Member Functions | |
LambdaCapture (SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, ValueDecl *Var=nullptr, SourceLocation EllipsisLoc=SourceLocation()) | |
Create a new capture of a variable or of this . | |
LambdaCaptureKind | getCaptureKind () const |
Determine the kind of capture. | |
bool | capturesThis () const |
Determine whether this capture handles the C++ this pointer. | |
bool | capturesVariable () const |
Determine whether this capture handles a variable. | |
bool | capturesVLAType () const |
Determine whether this captures a variable length array bound expression. | |
ValueDecl * | getCapturedVar () const |
Retrieve the declaration of the local variable being captured. | |
bool | isImplicit () const |
Determine whether this was an implicit capture (not written between the square brackets introducing the lambda). | |
bool | isExplicit () const |
Determine whether this was an explicit capture (written between the square brackets introducing the lambda). | |
SourceLocation | getLocation () const |
Retrieve the source location of the capture. | |
bool | isPackExpansion () const |
Determine whether this capture is a pack expansion, which captures a function parameter pack. | |
SourceLocation | getEllipsisLoc () const |
Retrieve the location of the ellipsis for a capture that is a pack expansion. | |
Friends | |
class | ASTStmtReader |
class | ASTStmtWriter |
Describes the capture of a variable or of this
, or of a C++1y init-capture.
Definition at line 25 of file LambdaCapture.h.
LambdaCapture::LambdaCapture | ( | SourceLocation | Loc, |
bool | Implicit, | ||
LambdaCaptureKind | Kind, | ||
ValueDecl * | Var = nullptr , |
||
SourceLocation | EllipsisLoc = SourceLocation() |
||
) |
Create a new capture of a variable or of this
.
Loc | The source location associated with this capture. |
Kind | The kind of capture (this, byref, bycopy), which must not be init-capture. |
Implicit | Whether the capture was implicit or explicit. |
Var | The local variable being captured, or null if capturing this . |
EllipsisLoc | The location of the ellipsis (...) for a capture that is a pack expansion, or an invalid source location to indicate that this is not a pack expansion. |
Definition at line 1215 of file ExprCXX.cpp.
References clang::Implicit, clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, and clang::LCK_VLAType.
|
inline |
Determine whether this capture handles the C++ this
pointer.
Definition at line 82 of file LambdaCapture.h.
Referenced by getCaptureKind().
|
inline |
Determine whether this capture handles a variable.
Definition at line 88 of file LambdaCapture.h.
Referenced by getCapturedVar(), clang::ASTNodeImporter::import(), and clang::sema::visitLocalsRetainedByInitializer().
|
inline |
Determine whether this captures a variable length array bound expression.
Definition at line 94 of file LambdaCapture.h.
Referenced by getCaptureKind().
|