Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 %s -fsyntax-only
      2 
      3 @interface NSObject
      4 + alloc;
      5 - init;
      6 @end
      7 
      8 struct D {
      9   double d;
     10 };
     11 
     12 @interface Foo : NSObject 
     13 
     14 - method:(int)a;
     15 - method:(int)a;
     16 
     17 @end
     18 
     19 @interface Bar : NSObject 
     20 
     21 - method:(void *)a;
     22 
     23 @end
     24 
     25 @interface Car : NSObject 
     26 
     27 - method:(struct D)a;
     28 
     29 @end
     30 
     31 @interface Zar : NSObject 
     32 
     33 - method:(float)a;
     34 
     35 @end
     36 
     37 @interface Rar : NSObject 
     38 
     39 - method:(float)a;
     40 
     41 @end
     42 
     43 int main() {
     44   id xx = [[Car alloc] init]; // expected-warning {{incompatible types assigning 'int' to 'id'}}
     45 
     46   [xx method:4];
     47 }
     48