type = Context->getObjCIdType();
// Make sure we convert "type (^)(...)" to "type (*)(...)".
(void)convertBlockPointerToFunctionPointer(type);
- userExpr = NoTypeInfoCStyleCastExpr(Context, type, CK_BitCast,
+ const Expr *SubExpr = ICE->IgnoreParenImpCasts();
+ bool integral = SubExpr->getType()->isIntegralType(*Context);
+ userExpr = NoTypeInfoCStyleCastExpr(Context, type,
+ (integral && type->isBooleanType())
+ ? CK_IntegralToBoolean : CK_BitCast,
userExpr);
}
// Make id<P...> cast into an 'id' cast.
--- /dev/null
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// radar 9899834
+
+void *sel_registerName(const char *);
+
+@interface NSURLDownload
+-(void)setBool:(bool)Arg;
+@end
+
+@implementation NSURLDownload
+- (void) Meth
+{
+ [self setBool:(signed char)1];
+}
+@end
+