Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 // rdar://7634850
      3 
      4 @interface Foo
      5 - (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}}
      6 @end
      7 
      8 void FUNC() {
      9     Class c, c1;
     10     SEL s1, s2;
     11     id i, i1;
     12     Foo *f;
     13     [f foo:f];	// expected-warning {{incompatible pointer types sending 'Foo *' to parameter of type 'Class'}}
     14     c = f;	// expected-warning {{incompatible pointer types assigning to 'Class' from 'Foo *'}}
     15 
     16     c = i;
     17 
     18     i = c;
     19 
     20     c = c1;
     21 
     22     i = i1;
     23 
     24     s1 = i;	// expected-warning {{incompatible pointer types assigning to 'SEL' from 'id'}}
     25     i = s1;	// expected-warning {{incompatible pointer types assigning to 'id' from 'SEL'}}
     26 
     27     s1 = s2;
     28 
     29     s1 = c;	// expected-warning {{incompatible pointer types assigning to 'SEL' from 'Class'}}
     30 
     31     c = s1;	// expected-warning {{incompatible pointer types assigning to 'Class' from 'SEL'}}
     32 
     33     f = i;
     34 
     35     f = c;	// expected-warning {{incompatible pointer types assigning to 'Foo *' from 'Class'}}
     36 
     37     f = s1;	// expected-warning {{incompatible pointer types assigning to 'Foo *' from 'SEL'}}
     38 
     39     i = f;
     40 
     41     s1 = f; 	// expected-warning {{incompatible pointer types assigning to 'SEL' from 'Foo *'}}
     42 }
     43