forked from OSchip/llvm-project
Conversions from Objective C object pointers to bool are "pointer conversions
to bool" in the sense of C++ [over.ics.rank]p4 bullet 1. I have decreed it. llvm-svn: 105817
This commit is contained in:
parent
5d474d0a96
commit
6d1116ac49
|
@ -155,7 +155,9 @@ bool StandardConversionSequence::isPointerConversionToBool() const {
|
|||
// check for their presence as well as checking whether FromType is
|
||||
// a pointer.
|
||||
if (getToType(1)->isBooleanType() &&
|
||||
(getFromType()->isPointerType() || getFromType()->isBlockPointerType() ||
|
||||
(getFromType()->isPointerType() ||
|
||||
getFromType()->isObjCObjectPointerType() ||
|
||||
getFromType()->isBlockPointerType() ||
|
||||
First == ICK_Array_To_Pointer || First == ICK_Function_To_Pointer))
|
||||
return true;
|
||||
|
||||
|
|
|
@ -93,3 +93,12 @@ void (*_NSExceptionRaiser(void))(NSException *) {
|
|||
objc_exception_functions_t exc_funcs;
|
||||
return exc_funcs.throw_exc; // expected-warning{{incompatible pointer types returning 'void (*)(NSException *)', expected 'void (*)(id)'}}
|
||||
}
|
||||
|
||||
namespace test5 {
|
||||
void foo(bool);
|
||||
void foo(void *);
|
||||
|
||||
void test(id p) {
|
||||
foo(p);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue