Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | 33afd77 | 2009-03-02 19:05:07 +0000 | [diff] [blame] | 2 | |
| 3 | @interface Foo |
Richard Trieu | 553b2b2 | 2011-12-15 00:38:15 +0000 | [diff] [blame] | 4 | - (int) garf; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 33afd77 | 2009-03-02 19:05:07 +0000 | [diff] [blame] | 5 | - (int) OK; |
Richard Trieu | 553b2b2 | 2011-12-15 00:38:15 +0000 | [diff] [blame] | 6 | + (int) cgarf; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 33afd77 | 2009-03-02 19:05:07 +0000 | [diff] [blame] | 7 | - (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 Jahanian | 83d674e | 2014-03-17 17:46:10 +0000 | [diff] [blame] | 16 | |
| 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 Kyrtzidis | 3a43754 | 2015-10-13 23:27:34 +0000 | [diff] [blame] | 29 | |
| 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 |