Support conversion from a null pointer constant o any Objective-C object pointer type. Fixes rdar://problem/6463298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61340 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 5fb1b14..8365349 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -767,6 +767,13 @@
   if (isObjCPointerConversion(FromType, ToType, ConvertedType, IncompatibleObjC))
     return true;
 
+  // Conversion from a null pointer constant to any Objective-C pointer type. 
+  if (Context.isObjCObjectPointerType(ToType) && 
+      From->isNullPointerConstant(Context)) {
+    ConvertedType = ToType;
+    return true;
+  }
+
   // Blocks: Block pointers can be converted to void*.
   if (FromType->isBlockPointerType() && ToType->isPointerType() &&
       ToType->getAsPointerType()->getPointeeType()->isVoidType()) {