Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 @interface Foo
      4 - (int)  garf; // expected-note {{previous declaration is here}}
      5 - (int) OK;
      6 + (int)  cgarf; // expected-note {{previous declaration is here}}
      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
     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
     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
     41