bool &IncompatibleObjC) {
if (!getLangOptions().ObjC1)
return false;
-
+
// First, we handle all conversions on ObjC object pointer types.
const ObjCObjectPointerType* ToObjCPtr = ToType->getAs<ObjCObjectPointerType>();
const ObjCObjectPointerType *FromObjCPtr =
ConvertedType = ToType;
return true;
}
+ // Allow conversion of pointee being objective-c pointer to another one;
+ // as in I* to id.
+ if (FromPointeeType->getAs<ObjCObjectPointerType>() &&
+ ToPointeeType->getAs<ObjCObjectPointerType>() &&
+ isObjCPointerConversion(FromPointeeType, ToPointeeType, ConvertedType,
+ IncompatibleObjC)) {
+ ConvertedType = ToType;
+ return true;
+ }
+
// If we have pointers to functions or blocks, check whether the only
// differences in the argument and result types are in Objective-C
// pointer conversions. If so, we permit the conversion (but
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+@interface G
+@end
+
+@interface F
+- (void)bar:(id *)objects;
+- (void)foo:(G**)objects;
+@end
+
+
+void a() {
+ F *b;
+ G **keys;
+ [b bar:keys];
+
+ id *PID;
+ [b foo:PID];
+
+}
+