1 // RUN: %clang_cc1 -fsyntax-only -verify -Wobjc-literal-conversion %s
6 + (NSNumber *)numberWithChar:(char)value;
7 + (NSNumber *)numberWithInt:(int)value;
8 + (NSNumber *)numberWithLongLong:(long long)value;
9 + (NSNumber *)numberWithFloat:(float)value;
10 + (NSNumber *)numberWithDouble:(double)value;
11 + (NSNumber *)numberWithBool:(bool)value;
15 + (id)arrayWithObjects:(const id [])objects count:(int)cnt;
18 @interface NSDictionary
19 + (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
24 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
29 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
31 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
33 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
35 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
40 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
42 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
44 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
46 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
51 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
53 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
58 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
62 if (@[ @313, @331, @367, @379 ]) {}
63 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
66 void dictionary_test() {
67 if (@{ @0: @0, @1: @1, @2: @1, @3: @3 }) {}
68 // expected-warning@-1{{implicit boolean conversion of Objective-C object literal always evaluates to true}}
71 void objc_bool_test () {