Patch to allow matching 0 with an objective-c pointer type
in objective-c++ mode. Fixes radar 7443165



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90874 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 567b488..be33c06 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1881,8 +1881,8 @@
   assert(getLangOptions().CPlusPlus && "This function assumes C++");
   QualType T1 = E1->getType(), T2 = E2->getType();
 
-  if (!T1->isPointerType() && !T1->isMemberPointerType() &&
-      !T2->isPointerType() && !T2->isMemberPointerType())
+  if (!T1->isAnyPointerType() && !T1->isMemberPointerType() &&
+      !T2->isAnyPointerType() && !T2->isMemberPointerType())
    return QualType();
 
   // C++0x 5.9p2
diff --git a/test/SemaObjCXX/composite-objc-pointertype.mm b/test/SemaObjCXX/composite-objc-pointertype.mm
new file mode 100644
index 0000000..8bbfa07
--- /dev/null
+++ b/test/SemaObjCXX/composite-objc-pointertype.mm
@@ -0,0 +1,18 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+@interface Foo
+@end
+
+@implementation Foo
+- (id)test {
+        id bar;
+    Class cl;
+    Foo *f;
+
+    (void)((bar!= 0) ? bar : 0);
+    (void)((cl != 0) ? cl : 0);
+    (void)((f != 0) ? 0 : f);
+    return (0 == 1) ? 0 : bar;
+}
+@end
+