blob: 99fdf530afd86729a735a1f6cb5827bfd6245436 [file] [log] [blame]
Fariborz Jahanian78e9deb2014-08-22 16:57:26 +00001// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -verify %s
2// rdar://16628028
3
4@interface NSObject
Fariborz Jahanian42292282014-08-25 21:27:38 +00005+ (void)initialize; // expected-note 2 {{method 'initialize' declared here}}
Fariborz Jahanian78e9deb2014-08-22 16:57:26 +00006@end
7
8@interface I : NSObject
9+ (void)initialize; // expected-note {{method 'initialize' declared here}}
Fariborz Jahanian42292282014-08-25 21:27:38 +000010+ (void)SomeRandomMethod;
Fariborz Jahanian78e9deb2014-08-22 16:57:26 +000011@end
12
13@implementation I
14- (void) Meth {
15 [I initialize]; // expected-warning {{explicit call to +initialize results in duplicate call to +initialize}}
16 [NSObject initialize]; // expected-warning {{explicit call to +initialize results in duplicate call to +initialize}}
17}
Fariborz Jahaniane8b45502014-08-22 19:52:49 +000018+ (void)initialize {
19 [super initialize];
20}
Fariborz Jahanian42292282014-08-25 21:27:38 +000021+ (void)SomeRandomMethod { // expected-note {{method 'SomeRandomMethod' declared here}}
22 [super initialize]; // expected-warning {{explicit call to [super initialize] should only be in implementation of +initialize}}
23}
Fariborz Jahanian78e9deb2014-08-22 16:57:26 +000024@end
25