aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-16 16:50:20 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-16 16:50:20 +0000
commit29a93f810ae5277446f610e8b6cdf0985febb989 (patch)
tree58f6311ea3dc93f8dcfbc20b750e3ce9cf9a488c /lib/Sema/SemaExpr.cpp
parentd0792de17387e949c27f97a5fa4a0b3e82db9b1e (diff)
Fix code generation of variables reference expressions when mixing
blocks and lambdas, based heavily on a patch from Meador Inge. Fixes PR12746 / <rdar://problem/11465120>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index e81787d5a4..440382bb5a 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -10069,7 +10069,7 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI,
// C++ [expr.prim.labda]p12:
// An entity captured by a lambda-expression is odr-used (3.2) in
// the scope containing the lambda-expression.
- Expr *Ref = new (S.Context) DeclRefExpr(Var, false, DeclRefType,
+ Expr *Ref = new (S.Context) DeclRefExpr(Var, true, DeclRefType,
VK_LValue, Loc);
Var->setReferenced(true);
Var->setUsed(true);