add some comments describing what is happening here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64896 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 5dba684..6e40b3c 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -20,9 +20,14 @@
 Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs, 
                                               ExprTy **Strings,
                                               unsigned NumStrings) {
-  SourceLocation AtLoc = AtLocs[0];
-  StringLiteral* S = static_cast<StringLiteral *>(Strings[0]);
-  if (NumStrings > 1) {
+  // Most ObjC strings are formed out of a single piece.  However, we *can*
+  // have strings formed out of multiple @ strings with multiple pptokens in
+  // each one, e.g. @"foo" "bar" @"baz" "qux"   which need to be turned into one
+  // StringLiteral for ObjCStringLiteral to hold onto.
+  StringLiteral *S = static_cast<StringLiteral *>(Strings[0]);
+  
+  // If we have a multi-part string, merge it all together.
+  if (NumStrings != 1) {
     // Concatenate objc strings.
     StringLiteral* ES = static_cast<StringLiteral *>(Strings[NumStrings-1]);
     SourceLocation EndLoc = ES->getSourceRange().getEnd();
@@ -33,19 +38,22 @@
     // FIXME: This should not be allocated by SEMA!
     char *strBuf = new char[Length];
     char *p = strBuf;
-    bool isWide = false;
     for (unsigned i = 0; i != NumStrings; ++i) {
       S = static_cast<StringLiteral *>(Strings[i]);
-      if (S->isWide())
-        isWide = true;
+      if (S->isWide()) {
+        Diag(S->getLocStart(), diag::err_cfstring_literal_not_string_constant)
+          << S->getSourceRange();
+        return true;
+      }
+      
       memcpy(p, S->getStrData(), S->getByteLength());
       p += S->getByteLength();
       S->Destroy(Context);
     }
     // FIXME: PASS LOCATIONS PROPERLY.
-    S = new (Context) StringLiteral(Context, strBuf, Length, isWide,
+    S = new (Context) StringLiteral(Context, strBuf, Length, false,
                                     Context.getPointerType(Context.CharTy),
-                                    AtLoc);
+                                    AtLocs[0]);
   }
   
   // Verify that this composite string is acceptable for ObjC strings.
@@ -71,7 +79,7 @@
     }
   }
   
-  return new (Context) ObjCStringLiteral(S, Ty, AtLoc);
+  return new (Context) ObjCStringLiteral(S, Ty, AtLocs[0]);
 }
 
 Sema::ExprResult Sema::ParseObjCEncodeExpression(SourceLocation AtLoc,