1 // RUN: %clang_cc1 -fsyntax-only -verify -Wattributes %s
3 typedef long NSInteger;
4 typedef unsigned long NSUInteger;
5 typedef signed char BOOL;
9 @interface NSNumber (NSNumberCreation)
10 + (NSNumber *)numberWithChar:(char)value;
11 + (NSNumber *)numberWithUnsignedChar:(unsigned char)value;
12 + (NSNumber *)numberWithShort:(short)value;
13 + (NSNumber *)numberWithUnsignedShort:(unsigned short)value;
14 + (NSNumber *)numberWithInt:(int)value;
15 + (NSNumber *)numberWithUnsignedInt:(unsigned int)value;
16 + (NSNumber *)numberWithLong:(long)value;
17 + (NSNumber *)numberWithUnsignedLong:(unsigned long)value;
18 + (NSNumber *)numberWithLongLong:(long long)value;
19 + (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value;
20 + (NSNumber *)numberWithFloat:(float)value;
21 + (NSNumber *)numberWithDouble:(double)value;
22 + (NSNumber *)numberWithBool:(BOOL)value;
23 + (NSNumber *)numberWithInteger:(NSInteger)value;
24 + (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value;
32 point p = { 0, 0, 0 };
33 id boxed = @(p); // expected-error {{illegal type 'point' used in a boxed expression}}
38 id boxed_null = @(null); // expected-error {{illegal type 'void *' used in a boxed expression}}
39 int numbers[] = { 0, 1, 2 };
40 id boxed_numbers = @(numbers); // expected-error {{illegal type 'int *' used in a boxed expression}}
44 @(not_defined); // expected-error {{use of undeclared identifier 'not_defined'}}
51 enum ForwE; // expected-error {{ISO C++ forbids forward references to 'enum' types}}
53 void testEnum(void *p) {
57 box = @(*(enum ForwE*)p); // expected-error {{incomplete type 'enum ForwE' used in a boxed expression}}