diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 470df58..abe29d2 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -1416,6 +1416,10 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, Expr **Args,
       } else if (const PointerType *PT = T->getAs<PointerType>()) {
         isConstant = T.isConstant(Context) &&
                      PT->getPointeeType().isConstant(Context);
+      } else if (T->isObjCObjectPointerType()) {
+        // In ObjC, there is usually no "const ObjectPointer" type,
+        // so don't check if the pointee type is constant.
+        isConstant = T.isConstant(Context);
       }
 
       if (isConstant) {
diff --git a/test/SemaObjC/format-strings-objc.m b/test/SemaObjC/format-strings-objc.m
index 078bd52..9e42282 100644
--- a/test/SemaObjC/format-strings-objc.m
+++ b/test/SemaObjC/format-strings-objc.m
@@ -90,3 +90,22 @@ extern NSString *GetLocalizedString(NSString *str);
 void check_NSLocalizedString() {
   [Foo fooWithFormat:NSLocalizedString(@"format"), @"arg"]; // no-warning
 }
+
+NSString *test_literal_propagation(void) {
+  const char * const s1 = "constant string %s"; // expected-note {{format string is defined here}}
+  printf(s1); // expected-warning {{more '%' conversions than data arguments}}
+  const char * const s5 = "constant string %s"; // expected-note {{format string is defined here}}
+  const char * const s2 = s5;
+  printf(s2); // expected-warning {{more '%' conversions than data arguments}}
+
+  const char * const s3 = (const char *)0;
+  printf(s3); // no-warning (null format is not an error)
+
+  NSString * const ns1 = @"constant string %s"; // expected-note {{format string is defined here}}
+  NSLog(ns1); // expected-warning {{more '%' conversions than data arguments}}
+  NSString * const ns5 = @"constant string %s"; // expected-note {{format string is defined here}}
+  NSString * const ns2 = ns5;
+  NSLog(ns2); // expected-warning {{more '%' conversions than data arguments}}
+  NSString * ns3 = ns1;
+  NSLog(ns3); // expected-warning {{format string is not a string literal}}}
+}
