aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 5fb1b14b98..8365349513 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -767,6 +767,13 @@ bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
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()) {