Actually, that doesn't really work, and anyway we should choose

conversion to id over conversion to void*.

llvm-svn: 117355
This commit is contained in:
John McCall 2010-10-26 06:40:27 +00:00
parent f28e83a73a
commit 75851b1a7f
2 changed files with 2 additions and 11 deletions

View File

@ -200,9 +200,6 @@ bool StandardConversionSequence::isPointerConversionToBool() const {
/// conversion is a conversion of a pointer to a void pointer. This is
/// used as part of the ranking of standard conversion sequences (C++
/// 13.3.3.2p4).
///
/// Note that we treat conversions of Objective-C pointers to
/// unqualified 'id' as having this same rank.
bool
StandardConversionSequence::
isPointerConversionToVoidPointer(ASTContext& Context) const {
@ -215,15 +212,9 @@ isPointerConversionToVoidPointer(ASTContext& Context) const {
if (First == ICK_Array_To_Pointer)
FromType = Context.getArrayDecayedType(FromType);
if (Second == ICK_Pointer_Conversion && FromType->isPointerType()) {
if (Second == ICK_Pointer_Conversion && FromType->isPointerType())
if (const PointerType* ToPtrType = ToType->getAs<PointerType>())
return ToPtrType->getPointeeType()->isVoidType();
} else if (Second == ICK_Pointer_Conversion &&
FromType->isObjCObjectPointerType()) {
if (const ObjCObjectPointerType *ToPtrType =
ToType->getAs<ObjCObjectPointerType>())
return ToPtrType->isObjCIdType();
}
return false;
}

View File

@ -120,6 +120,6 @@ namespace test6 {
void foo(A*) __attribute__((unavailable)); // expected-note {{explicitly made unavailable}}
void test(B *b) {
foo(b); // expected-error {{call to unavailable function}}
foo(b); // expected-error {{call to 'foo' is ambiguous}}
}
}