Allow messaging expression as foreach's collection expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45793 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaStmt.cpp b/Sema/SemaStmt.cpp
index 7f540d4..fbe9294 100644
--- a/Sema/SemaStmt.cpp
+++ b/Sema/SemaStmt.cpp
@@ -531,7 +531,7 @@
 }
 
 Action::StmtResult 
-Sema::ActOnObjCForCollectionStmt(SourceLocation ForColLoc, 
+Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc, 
                                  SourceLocation LParenLoc, 
                                  StmtTy *first, ExprTy *second,
                                  SourceLocation RParenLoc, StmtTy *body) {
@@ -553,16 +553,16 @@
   else
     FirstType = static_cast<Expr*>(first)->getType();
   if (!isObjCObjectPointerType(FirstType))
-      Diag(ForColLoc, diag::err_selector_element_type,
+      Diag(ForLoc, diag::err_selector_element_type,
            FirstType.getAsString(), First->getSourceRange());
   if (Second) {
     DefaultFunctionArrayConversion(Second);
     QualType SecondType = Second->getType();
     if (!isObjCObjectPointerType(SecondType))
-      Diag(ForColLoc, diag::err_collection_expr_type,
+      Diag(ForLoc, diag::err_collection_expr_type,
            SecondType.getAsString(), Second->getSourceRange());
   }
-  return new ObjCForCollectionStmt(First, Second, Body, ForColLoc);
+  return new ObjCForCollectionStmt(First, Second, Body, ForLoc, RParenLoc);
 }
 
 Action::StmtResult