blob: 446d2be0378e491322d370032504d4ed8ccbd4ab [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian33afd772009-03-02 19:05:07 +00002
3@interface Foo
Richard Trieu553b2b22011-12-15 00:38:15 +00004- (int) garf; // expected-note {{previous declaration is here}}
Fariborz Jahanian33afd772009-03-02 19:05:07 +00005- (int) OK;
Richard Trieu553b2b22011-12-15 00:38:15 +00006+ (int) cgarf; // expected-note {{previous declaration is here}}
Fariborz Jahanian33afd772009-03-02 19:05:07 +00007- (int) InstMeth;
8@end
9
10@interface Foo()
11- (void) garf; // expected-error {{duplicate declaration of method 'garf'}}
12+ (void) cgarf; // expected-error {{duplicate declaration of method 'cgarf'}}
13+ (int) InstMeth;
14- (int) OK;
15@end
Fariborz Jahanian83d674e2014-03-17 17:46:10 +000016
17// rdar://16312105
18@class NSObject;
19
20__attribute__((objc_root_class)) @interface AppDelegate
21+ (void)someMethodWithArgument:(NSObject *)argument;
22+ (void)someMethodWithArgument:(NSObject *)argument : (NSObject*) argument2; // expected-note {{previous declaration is here}}
23@end
24
25@interface AppDelegate ()
26- (void)someMethodWithArgument:(float)argument; // OK. No warning to be issued here.
27+ (void)someMethodWithArgument:(float)argument : (float)argument2; // expected-error {{duplicate declaration of method 'someMethodWithArgument::'}}
28@end
Argyrios Kyrtzidis3a437542015-10-13 23:27:34 +000029
30__attribute__((objc_root_class))
31@interface Test
32-(void)meth; // expected-note {{declared here}}
33@end
34
35@interface Test()
36-(void)meth;
37@end
38
39@implementation Test // expected-warning {{method definition for 'meth' not found}}
40@end