1 // RUN: %clang_cc1 -triple x86_64-apple-macos10.10 %s -verify=c,expected
2 // RUN: %clang_cc1 -triple x86_64-apple-macos10.10 %s -xobjective-c++ -verify=cxx,expected
3 // RUN: %clang_cc1 -triple x86_64-apple-macos10.10 %s -fobjc-arc -verify=c,arc,expected
5 typedef signed char BOOL;
10 +(instancetype)numberWithChar:(char)value;
11 +(instancetype)numberWithInt:(int)value;
12 +(instancetype)numberWithDouble:(double)value;
13 +(instancetype)numberWithBool:(BOOL)value;
17 NSNumber *n = YES; // expected-error{{numeric literal must be prefixed by '@'}}
18 NSNumber *n1 = 1; // expected-error{{numeric literal must be prefixed by '@'}}
20 NSNumber *n2 = NO; // c-warning{{expression which evaluates to zero treated as a null pointer constant}}
21 // cxx-error@-1{{numeric literal must be prefixed by '@'}}
23 NSNumber *n4 = 0.0; // expected-error{{numeric literal must be prefixed by '@'}}
25 NSNumber *n5 = '\0'; // c-warning{{expression which evaluates to zero treated as a null pointer constant}}
26 // cxx-error@-1{{numeric literal must be prefixed by '@'}}
29 NSNumber *n6 = '1'; // expected-error{{numeric literal must be prefixed by '@'}}
32 NSNumber *n7 = i; // c-error{{incompatible integer to pointer conversion}}
33 // arc-error@-1{{implicit conversion of 'int' to 'NSNumber *' is disallowed with ARC}}
34 // cxx-error@-2{{cannot initialize a variable of type 'NSNumber *' with an lvalue of type 'int'}}
36 id n8 = 1; // c-error{{incompatible integer to pointer conversion}}
37 // arc-error@-1{{implicit conversion of 'int' to 'id' is disallowed with ARC}}
38 // cxx-error@-2{{cannot initialize a variable of type 'id' with an rvalue of type 'int'}}