| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// expected-no-diagnostics |
| 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 |
|
| 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]; |
| 30 |
o = x.foo; |
| 31 |
[x setFoo:o]; |
| 32 |
x.foo = o; |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
@end |
| 37 |
|