summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 027ec73d494..149201192f3 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -9630,6 +9630,7 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI,
// 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, DeclRefType, VK_LValue, Loc);
+ Var->setReferenced(true);
Var->setUsed(true);
// When the field has array type, create index variables for each
OpenPOWER on IntegriCloud