ImpCastExprToType(rex, lType); // promote the pointer to pointer
return Context.IntTy;
}
+ // Allow block pointers to be compared with null pointer constants.
+ if ((lType->isBlockPointerType() && rType->isPointerType()) ||
+ (lType->isPointerType() && rType->isBlockPointerType())) {
+ if (!LHSIsNull && !RHSIsNull) {
+ Diag(loc, diag::err_typecheck_comparison_of_distinct_blocks,
+ lType.getAsString(), rType.getAsString(),
+ lex->getSourceRange(), rex->getSourceRange());
+ }
+ ImpCastExprToType(rex, lType); // promote the pointer to pointer
+ return Context.IntTy;
+ }
if ((lType->isObjCQualifiedIdType() || rType->isObjCQualifiedIdType())) {
if (ObjCQualifiedIdTypesAreCompatible(lType, rType, true)) {
}
static int funk(char *s) {
- return 1;
+ if (^{} == ((void*)0))
+ return 1;
+ else
+ return 0;
}
void foo4() {
int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-warning {{incompatible block pointer types initializing 'int (^)(char *)', expected 'int (^)(char const *)'}}