Steve Naroff | b1c7ad9 | 2007-11-11 00:10:47 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | @interface foo |
| 4 | - (void)meth; |
| 5 | @end |
| 6 | |
| 7 | @implementation foo |
| 8 | - (void) contents {} // No declaration in @interface! |
Steve Naroff | b82c50f | 2007-11-11 17:19:15 +0000 | [diff] [blame] | 9 | - (void) meth { [self contents]; } |
Steve Naroff | b1c7ad9 | 2007-11-11 00:10:47 +0000 | [diff] [blame] | 10 | @end |
| 11 | |
Steve Naroff | 4e3d3ec | 2007-12-11 03:34:41 +0000 | [diff] [blame] | 12 | typedef struct _NSPoint { |
| 13 | float x; |
| 14 | float y; |
| 15 | } NSPoint; |
| 16 | |
| 17 | typedef struct _NSSize { |
| 18 | float width; |
| 19 | float height; |
| 20 | } NSSize; |
| 21 | |
| 22 | typedef struct _NSRect { |
| 23 | NSPoint origin; |
| 24 | NSSize size; |
| 25 | } NSRect; |
| 26 | |
| 27 | @interface AnyClass |
| 28 | - (NSRect)rect; |
| 29 | @end |
| 30 | |
| 31 | @class Helicopter; |
| 32 | |
| 33 | static void func(Helicopter *obj) { |
| 34 | // Note that the proto for "rect" is found in the global pool even when |
| 35 | // a statically typed object's class interface isn't in scope! This |
| 36 | // behavior isn't very desirable, however wee need it for GCC compatibility. |
| 37 | NSRect r = [obj rect]; |
| 38 | } |