forked from OSchip/llvm-project
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:
parent
b095e15af4
commit
8811885366
|
@ -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())) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue