1 | // RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -verify %s |
2 | // rdar://16628028 |
3 | |
4 | @interface NSObject |
5 | + (void)initialize; // expected-note 2 {{method 'initialize' declared here}} |
6 | @end |
7 | |
8 | @interface I : NSObject |
9 | + (void)initialize; // expected-note {{method 'initialize' declared here}} |
10 | + (void)SomeRandomMethod; |
11 | @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 | } |
18 | + (void)initialize { |
19 | [super initialize]; |
20 | } |
21 | + (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 | } |
24 | @end |
25 | |
26 | |