]> granicus.if.org Git - clang/commitdiff
Actually, that doesn't really work, and anyway we should choose
authorJohn McCall <rjmccall@apple.com>
Tue, 26 Oct 2010 06:40:27 +0000 (06:40 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 26 Oct 2010 06:40:27 +0000 (06:40 +0000)
conversion to id over conversion to void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117355 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp
test/SemaObjCXX/overload.mm

index 7244582829e0800662a377b0b58332828b9844ea..8f653d1df086c22854c1e628eb00e23d454ba1df 100644 (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;
 }
index f8c917cf2abddb43e462b56cce6e3647e5728374..b824fa64b73366334ef1aa4989bbbe711170dda9 100644 (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}}
   }
 }