argTy->isNullPtrType();
case ObjCPointerTy:
- return argTy->getAs<ObjCObjectPointerType>() != NULL;
+ return argTy->getAs<ObjCObjectPointerType>() ||
+ argTy->getAs<BlockPointerType>();
}
llvm_unreachable("Invalid ArgTypeResult Kind!");
return ArgTypeResult(Ctx.WCharTy, "wchar_t");
case ConversionSpecifier::pArg:
return ArgTypeResult::CPointerTy;
+ case ConversionSpecifier::ObjCObjArg:
+ return ArgTypeResult::ObjCPointerTy;
default:
break;
}
typedef unsigned int NSUInteger;
@class NSString, Protocol;
extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
+extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
typedef struct _NSZone NSZone;
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
@protocol NSObject - (BOOL)isEqual:(id)object; @end
[Foo fooWithFormat:@"%@"]; // expected-warning {{more '%' conversions than data arguments}}
[Foo fooWithCStringFormat:"%@"]; // expected-warning {{invalid conversion specifier '@'}}
}
+
+// Warn about using BOOL with %@
+void rdar10743758(id x) {
+ NSLog(@"%@ %@", x, (BOOL) 1); // expected-warning {{format specifies type 'id' but the argument has type 'BOOL' (aka 'signed char')}}
+}
+