aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index aa2e2a53d6..88512af8b3 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3037,7 +3037,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
SourceLocation(),
Owned(E));
if (!Res.isInvalid()) {
- Res = MaybeCreateExprWithCleanups(Res.get());
+ Res = MaybeCreateExprWithCleanups(Res);
Expr *Init = Res.takeAs<Expr>();
Context.setBlockVarCopyInits(NewVD, Init);
}
@@ -4805,7 +4805,7 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl,
if (Init.isInvalid())
Var->setInvalidDecl();
else if (Init.get()) {
- Var->setInit(MaybeCreateExprWithCleanups(Init.takeAs<Expr>()));
+ Var->setInit(MaybeCreateExprWithCleanups(Init.get()));
if (getLangOptions().CPlusPlus && !Var->isInvalidDecl() &&
Var->hasGlobalStorage() && !Var->isStaticLocal() &&