diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-05-16 16:50:20 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-05-16 16:50:20 +0000 |
| commit | 26b51746ec3cb2590cd36be08ecacb399c7c7faf (patch) | |
| tree | e716ccab97f2b68d8a299b3f289894cda10cacdd /clang/lib/Sema/SemaExpr.cpp | |
| parent | f015a94f0919b2d8dd81c97cbc287e86ce652378 (diff) | |
| download | bcm5719-llvm-26b51746ec3cb2590cd36be08ecacb399c7c7faf.tar.gz bcm5719-llvm-26b51746ec3cb2590cd36be08ecacb399c7c7faf.zip | |
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>.
llvm-svn: 156925
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e81787d5a4b..440382bb5a3 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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); |

