Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
Douglas Gregor | 50f4e70 | 2009-02-07 17:16:20 +0000 | [diff] [blame] | 2 | |
| 3 | // <rdar://problem/6463729> |
| 4 | @class XX; |
| 5 | |
| 6 | void func() { |
| 7 | XX *obj; |
| 8 | void *vv; |
| 9 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 10 | obj = vv; // expected-error{{assigning to 'XX *' from incompatible type 'void *'}} |
Douglas Gregor | 50f4e70 | 2009-02-07 17:16:20 +0000 | [diff] [blame] | 11 | } |
Fariborz Jahanian | 2f6c550 | 2010-05-10 23:46:53 +0000 | [diff] [blame] | 12 | |
| 13 | // <rdar://problem/7952457> |
| 14 | @interface I |
| 15 | { |
| 16 | void* delegate; |
| 17 | } |
| 18 | - (I*) Meth; |
| 19 | - (I*) Meth1; |
| 20 | @end |
| 21 | |
| 22 | @implementation I |
| 23 | - (I*) Meth { return static_cast<I*>(delegate); } |
| 24 | - (I*) Meth1 { return reinterpret_cast<I*>(delegate); } |
| 25 | @end |
| 26 | |