Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify %s |
Steve Naroff | d824c9c | 2009-04-14 15:11:46 +0000 | [diff] [blame] | 2 | |
| 3 | typedef struct objc_class *Class; |
| 4 | @interface XX |
| 5 | |
Douglas Gregor | a41a8c5 | 2010-04-22 00:20:18 +0000 | [diff] [blame] | 6 | - (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}} |
Steve Naroff | d824c9c | 2009-04-14 15:11:46 +0000 | [diff] [blame] | 7 | |
| 8 | @end |
| 9 | |
| 10 | @interface YY |
| 11 | |
| 12 | + (void)classMethod; |
| 13 | |
| 14 | @end |
| 15 | |
| 16 | @implementation YY |
| 17 | |
| 18 | static XX *obj; |
| 19 | |
| 20 | + (void)classMethod { |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 21 | [obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}} |
Steve Naroff | d824c9c | 2009-04-14 15:11:46 +0000 | [diff] [blame] | 22 | Class whatever; |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 23 | [obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}} |
Steve Naroff | d824c9c | 2009-04-14 15:11:46 +0000 | [diff] [blame] | 24 | } |
| 25 | @end |
| 26 | |