1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 // RUN: cp %s %t 3 // RUN: not %clang_cc1 -fsyntax-only -fixit -x objective-c %t 4 // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x objective-c %t 5 6 typedef unsigned char BOOL; 7 8 @interface NSObject 9 @end 10 11 @interface NSNumber : NSObject 12 + (NSNumber *)numberWithChar:(char)value; 13 + (NSNumber *)numberWithUnsignedChar:(unsigned char)value; 14 + (NSNumber *)numberWithShort:(short)value; 15 + (NSNumber *)numberWithUnsignedShort:(unsigned short)value; 16 + (NSNumber *)numberWithInt:(int)value; 17 + (NSNumber *)numberWithUnsignedInt:(unsigned int)value; 18 + (NSNumber *)numberWithLong:(long)value; 19 + (NSNumber *)numberWithUnsignedLong:(unsigned long)value; 20 + (NSNumber *)numberWithLongLong:(long long)value; 21 + (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value; 22 + (NSNumber *)numberWithFloat:(float)value; 23 + (NSNumber *)numberWithDouble:(double)value; 24 + (NSNumber *)numberWithBool:(BOOL)value; 25 @end 26 27 @interface NSArray : NSObject 28 + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; 29 @end 30 31 @interface NSDictionary : NSObject 32 + (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt; 33 @end 34 35 @interface NSString : NSObject 36 @end 37 38 void fixes() { 39 id arr = @[ 40 17, // expected-error{{numeric literal must be prefixed by '@' in a collection}} 41 'a', // expected-error{{character literal must be prefixed by '@'}} 42 "blah" // expected-error{{string literal must be prefixed by '@'}} 43 ]; 44 } 45