Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | 24fce28 | 2010-11-09 02:16:57 +0000 | [diff] [blame] | 2 | // rdar://7634850 |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 3 | |
| 4 | @interface Foo |
Douglas Gregor | a41a8c5 | 2010-04-22 00:20:18 +0000 | [diff] [blame] | 5 | - (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 6 | @end |
| 7 | |
| 8 | void FUNC() { |
| 9 | Class c, c1; |
| 10 | SEL s1, s2; |
| 11 | id i, i1; |
| 12 | Foo *f; |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 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 *'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 15 | |
| 16 | c = i; |
| 17 | |
| 18 | i = c; |
| 19 | |
| 20 | c = c1; |
| 21 | |
| 22 | i = i1; |
| 23 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 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'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 26 | |
| 27 | s1 = s2; |
| 28 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 29 | s1 = c; // expected-warning {{incompatible pointer types assigning to 'SEL' from 'Class'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 30 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 31 | c = s1; // expected-warning {{incompatible pointer types assigning to 'Class' from 'SEL'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 32 | |
| 33 | f = i; |
| 34 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 35 | f = c; // expected-warning {{incompatible pointer types assigning to 'Foo *' from 'Class'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 36 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 37 | f = s1; // expected-warning {{incompatible pointer types assigning to 'Foo *' from 'SEL'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 38 | |
| 39 | i = f; |
| 40 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 41 | s1 = f; // expected-warning {{incompatible pointer types assigning to 'SEL' from 'Foo *'}} |
Fariborz Jahanian | d4c6090 | 2010-03-19 18:06:10 +0000 | [diff] [blame] | 42 | } |