Consider conversion of objective-c pointer to 'bool' a

valid standard conversion to match g++'s behaviour.

llvm-svn: 91157
This commit is contained in:
Fariborz Jahanian 2009-12-11 21:23:13 +00:00
parent b095e15af4
commit 8811885366
2 changed files with 13 additions and 1 deletions

View File

@ -674,7 +674,7 @@ Sema::IsStandardConversion(Expr* From, QualType ToType,
} else if (ToType->isBooleanType() &&
(FromType->isArithmeticType() ||
FromType->isEnumeralType() ||
FromType->isPointerType() ||
FromType->isAnyPointerType() ||
FromType->isBlockPointerType() ||
FromType->isMemberPointerType() ||
FromType->isNullPtrType())) {

View File

@ -0,0 +1,12 @@
// RUN: clang-cc -fsyntax-only -verify %s
@class NSString;
id a;
NSString *b;
void f() {
bool b1 = a;
bool b2 = b;
}