aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-03-01 21:32:56 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-03-01 21:32:56 +0000
commit88530d5e138f36ea80a7d70c14f37095b8eba85b (patch)
treed617885a4f03800d2fb7e5b9d90e55859d7b7c0c /lib/Sema
parent3638fabcf2eddcd072c06d0f90f774547f6d7e01 (diff)
Fix the isReferenced bit on parameters in a couple of edge cases. PR12153.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp1
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 027ec73d49..149201192f 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
index 15a308575a..3a547ddf68 100644
--- a/lib/Sema/SemaTemplateVariadic.cpp
+++ b/lib/Sema/SemaTemplateVariadic.cpp
@@ -779,6 +779,8 @@ ExprResult Sema::ActOnSizeofParameterPackExpr(Scope *S,
return ExprError();
}
+ MarkAnyDeclReferenced(OpLoc, ParameterPack);
+
return new (Context) SizeOfPackExpr(Context.getSizeType(), OpLoc,
ParameterPack, NameLoc, RParenLoc);
}