diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-15 16:57:26 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-15 16:57:26 +0000 |
commit | 4773654f2700d6fbb20612fbb6763b35860fa74d (patch) | |
tree | 48bb63d5d1bdca8926cba42f0fac882e6cd2433f /lib/Sema/SemaExpr.cpp | |
parent | badb6cd2007825308208e6c4275ba54e220e4e28 (diff) |
Introduce a new initialization entity for lambda captures, and
specialize location information and diagnostics for this entity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index a11cba1bfb..b05f4d5623 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -9625,8 +9625,6 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI, // direct-initialized in increasing subscript order.) These // initializations are performed in the (unspecified) order in // which the non-static data members are declared. - // - // FIXME: Introduce an initialization entity for lambda captures. // Introduce a new evaluation context for the initialization, so // that temporaries introduced as part of the capture are retained @@ -9697,7 +9695,8 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI, // of array-subscript entities. SmallVector<InitializedEntity, 4> Entities; Entities.reserve(1 + IndexVariables.size()); - Entities.push_back(InitializedEntity::InitializeMember(Field)); + Entities.push_back( + InitializedEntity::InitializeLambdaCapture(Var, Field, Loc)); for (unsigned I = 0, N = IndexVariables.size(); I != N; ++I) Entities.push_back(InitializedEntity::InitializeElement(S.Context, 0, |