Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Steve Naroff | 7692ed6 | 2008-10-22 19:16:27 +0000 | [diff] [blame] | 2 | |
| 3 | @interface NSSound |
| 4 | @end |
| 5 | @interface NSFont |
| 6 | @end |
| 7 | |
| 8 | @interface NSSound (Adds) |
| 9 | @end |
| 10 | |
| 11 | @implementation NSSound (Adds) |
| 12 | - foo { |
| 13 | return self; |
| 14 | } |
| 15 | - (void)setFoo:obj { |
| 16 | } |
| 17 | @end |
| 18 | |
| 19 | @implementation NSFont (Adds) |
| 20 | |
| 21 | - xx { |
| 22 | NSSound *x; |
| 23 | id o; |
| 24 | |
Steve Naroff | 0de21fd | 2009-02-22 19:35:57 +0000 | [diff] [blame] | 25 | // GCC does *not* warn about the following. Since foo/setFoo: are not in the |
| 26 | // class or category interface for NSSound, the compiler shouldn't find them. |
| 27 | // For now, we will support GCC's behavior (sigh). |
| 28 | o = [x foo]; |
Steve Naroff | 7692ed6 | 2008-10-22 19:16:27 +0000 | [diff] [blame] | 29 | o = x.foo; |
| 30 | [x setFoo:o]; |
| 31 | x.foo = o; |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 32 | return 0; |
Steve Naroff | 7692ed6 | 2008-10-22 19:16:27 +0000 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | @end |
| 36 | |