1 // RUN: %clang_cc1 -Wno-objc-root-class %s -verify
2 // RUN: %clang_cc1 -xobjective-c++ -Wno-objc-root-class %s -verify
8 +(instancetype)numberWithChar:(char)value;
9 +(instancetype)numberWithInt:(int)value;
10 +(instancetype)numberWithDouble:(double)value;
11 +(instancetype)numberWithBool:(unsigned char)value;
12 +(instancetype)numberWithUnsignedLong:(unsigned long)value;
13 +(instancetype)numberWithLongLong:(long long) value;
14 +(instancetype)numberWithUnsignedInt:(unsigned)value;
20 @interface NSDictionary
21 + (instancetype)dictionaryWithObjects:(const id[])objects
22 forKeys:(const id[])keys
23 count:(unsigned long)cnt;
28 @"foo" : @0, // expected-note 2 {{previous equal key is here}}
29 @"foo" : @0, // expected-warning{{duplicate key in dictionary literal}}
30 @("foo") : @0, // expected-warning{{duplicate key in dictionary literal}}
33 @1 : @0, // expected-note + {{previous equal key is here}}
34 @YES : @0, // expected-warning{{duplicate key in dictionary literal}}
35 @'\1' : @0, // expected-warning{{duplicate key in dictionary literal}}
36 @1 : @0, // expected-warning{{duplicate key in dictionary literal}}
37 @1ul : @0, // expected-warning{{duplicate key in dictionary literal}}
38 @1ll : @0, // expected-warning{{duplicate key in dictionary literal}}
40 @true : @0, // expected-warning{{duplicate key in dictionary literal}}
42 @1.0 : @0, // FIXME: should warn
44 @-1 : @0, // expected-note + {{previous equal key is here}}
45 @4294967295u : @0, // no warning
46 @-1ll : @0, // expected-warning{{duplicate key in dictionary literal}}
47 @(NO-YES) : @0, // expected-warning{{duplicate key in dictionary literal}}
52 template <class... Ts> void variadic(Ts... ts) {
55 @0 : ts ... // expected-warning 2 {{duplicate key in dictionary literal}} expected-note 2 {{previous equal key is here}}
59 void call_variadic() {
60 variadic(@0, @1, @2); // expected-note {{in instantiation}}