[cfe-commits] r117355 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/SemaObjCXX/overload.mm
John McCall
rjmccall at apple.com
Mon Oct 25 23:40:27 PDT 2010
Author: rjmccall
Date: Tue Oct 26 01:40:27 2010
New Revision: 117355
URL: http://llvm.org/viewvc/llvm-project?rev=117355&view=rev
Log:
Actually, that doesn't really work, and anyway we should choose
conversion to id over conversion to void*.
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/test/SemaObjCXX/overload.mm
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=117355&r1=117354&r2=117355&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue Oct 26 01:40:27 2010
@@ -200,9 +200,6 @@
/// 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 @@
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;
}
Modified: cfe/trunk/test/SemaObjCXX/overload.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/overload.mm?rev=117355&r1=117354&r2=117355&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/overload.mm (original)
+++ cfe/trunk/test/SemaObjCXX/overload.mm Tue Oct 26 01:40:27 2010
@@ -120,6 +120,6 @@
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}}
}
}
More information about the cfe-commits
mailing list