aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r--lib/Rewrite/RewriteObjC.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 659fe74154..cf11dc64c6 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -4562,7 +4562,8 @@ void RewriteObjC::GetBlockDeclRefExprs(Stmt *S) {
else if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(S))
if (HasLocalVariableExternalStorage(DRE->getDecl())) {
BlockDeclRefExpr *BDRE =
- new (Context)BlockDeclRefExpr(DRE->getDecl(), DRE->getType(),
+ new (Context)BlockDeclRefExpr(cast<VarDecl>(DRE->getDecl()),
+ DRE->getType(),
VK_LValue, DRE->getLocation(), false);
BlockDeclRefs.push_back(BDRE);
}