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