Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s |
Fariborz Jahanian | 7b5e1b8 | 2007-12-21 23:48:59 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 3886012 | 2008-01-09 00:33:05 +0000 | [diff] [blame] | 3 | @interface Derived |
Fariborz Jahanian | 7b5e1b8 | 2007-12-21 23:48:59 +0000 | [diff] [blame] | 4 | @end |
| 5 | |
Fariborz Jahanian | 3886012 | 2008-01-09 00:33:05 +0000 | [diff] [blame] | 6 | @interface Object @end |
| 7 | |
Fariborz Jahanian | 7b5e1b8 | 2007-12-21 23:48:59 +0000 | [diff] [blame] | 8 | extern Object* foo(void); |
| 9 | |
| 10 | static Derived *test(void) |
| 11 | { |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 12 | Derived *m = foo(); // expected-warning {{incompatible pointer types initializing 'Derived *' with an expression of type 'Object *'}} |
Fariborz Jahanian | 7b5e1b8 | 2007-12-21 23:48:59 +0000 | [diff] [blame] | 13 | |
| 14 | return m; |
| 15 | } |
| 16 | |