Objective-C pointer to void* as a "conversion to void*". This allows
us to prefer an Objective-C object pointer conversion to a superclass
object pointer over an Objective-C object pointer conversion to
cv-void*. Fixes PR9735.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129603
91177308-0d34-0410-b5e6-
96231b3b80d8
if (First == ICK_Array_To_Pointer)
FromType = Context.getArrayDecayedType(FromType);
- if (Second == ICK_Pointer_Conversion && FromType->isPointerType())
+ if (Second == ICK_Pointer_Conversion && FromType->isAnyPointerType())
if (const PointerType* ToPtrType = ToType->getAs<PointerType>())
return ToPtrType->getPointeeType()->isVoidType();
f2(a);
}
}
+
+namespace PR9735 {
+ int &f3(const A*);
+ float &f3(const void*);
+
+ void test_f(B* b, const B* bc) {
+ int &ir1 = f3(b);
+ int &ir2 = f3(bc);
+ }
+}