Sema::ActOnIdentifierExpr(): Lookup block arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56063 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 8a297ac..80b33f2 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -354,7 +354,12 @@
       return new PredefinedExpr(Loc, T, PredefinedExpr::ObjCSuper);
     }
   }
-  
+  // If we are parsing a block, check the block parameter list.
+  if (CurBlock) {
+    for (unsigned i = 0, e = CurBlock->Params.size(); i != e; ++i)
+      if (CurBlock->Params[i]->getIdentifier() == &II)
+        D = CurBlock->Params[i];
+  }
   if (D == 0) {
     // Otherwise, this could be an implicitly declared function reference (legal
     // in C90, extension in C99).