aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2025-05-02 09:29:08 +0300
committerVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2025-05-02 09:29:35 +0300
commit048befe9ef7edab3580a922d69664b21e2a532fa (patch)
tree77501f82ce679cf85672d0c23e732470134e4ff9 /clang/lib/Sema/SemaLambda.cpp
parentbe6497ff7583248d76a6710dd48cfeb63dd68f27 (diff)
downloadllvm-048befe9ef7edab3580a922d69664b21e2a532fa.zip
llvm-048befe9ef7edab3580a922d69664b21e2a532fa.tar.gz
llvm-048befe9ef7edab3580a922d69664b21e2a532fa.tar.bz2
Revert "[clang][NFC] Convert `Sema::TryCaptureKind` to scoped enum"
This reverts commit be6497ff7583248d76a6710dd48cfeb63dd68f27.
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 28fcef8..1183a04 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -207,12 +207,13 @@ UnsignedOrNone clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(
// checking whether all enclosing lambdas of the capture-ready lambda allow
// the capture - i.e. make sure it is capture-capable.
QualType CaptureType, DeclRefType;
- const bool CanCaptureVariable = !S.tryCaptureVariable(
- VarToCapture,
- /*ExprVarIsUsedInLoc*/ SourceLocation(), TryCaptureKind::Implicit,
- /*EllipsisLoc*/ SourceLocation(),
- /*BuildAndDiagnose*/ false, CaptureType, DeclRefType,
- &IndexOfCaptureReadyLambda);
+ const bool CanCaptureVariable =
+ !S.tryCaptureVariable(VarToCapture,
+ /*ExprVarIsUsedInLoc*/ SourceLocation(),
+ clang::Sema::TryCapture_Implicit,
+ /*EllipsisLoc*/ SourceLocation(),
+ /*BuildAndDiagnose*/ false, CaptureType,
+ DeclRefType, &IndexOfCaptureReadyLambda);
if (!CanCaptureVariable)
return NoLambdaIsCaptureCapable;
} else {
@@ -1347,9 +1348,8 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro,
if (C->Init.isUsable()) {
addInitCapture(LSI, cast<VarDecl>(Var), C->Kind == LCK_ByRef);
} else {
- TryCaptureKind Kind = C->Kind == LCK_ByRef
- ? TryCaptureKind::ExplicitByRef
- : TryCaptureKind::ExplicitByVal;
+ TryCaptureKind Kind = C->Kind == LCK_ByRef ? TryCapture_ExplicitByRef
+ : TryCapture_ExplicitByVal;
tryCaptureVariable(Var, C->Loc, Kind, EllipsisLoc);
}
if (!LSI->Captures.empty())