| 1 |
// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c -fobjc-arc %s 2>&1 | FileCheck %s |
| 2 |
// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c++ -fobjc-arc %s 2>&1 | FileCheck %s |
| 3 |
|
| 4 |
typedef struct __attribute__((objc_bridge_related(UIColor,colorWithCGColor:,CGColor))) CGColor *CGColorRef; |
| 5 |
|
| 6 |
@interface UIColor |
| 7 |
+ (UIColor *)colorWithCGColor:(CGColorRef)cgColor; |
| 8 |
- (CGColorRef)CGColor; |
| 9 |
@end |
| 10 |
|
| 11 |
@interface UIButton |
| 12 |
@property(nonatomic,retain) UIColor *tintColor; |
| 13 |
@end |
| 14 |
|
| 15 |
void test(UIButton *myButton) { |
| 16 |
CGColorRef cgColor = (CGColorRef)myButton.tintColor; |
| 17 |
cgColor = myButton.tintColor; |
| 18 |
|
| 19 |
cgColor = (CGColorRef)[myButton.tintColor CGColor]; |
| 20 |
|
| 21 |
cgColor = (CGColorRef)[myButton tintColor]; |
| 22 |
} |
| 23 |
|
| 24 |
// CHECK: {16:36-16:36}:"[" |
| 25 |
// CHECK: {16:54-16:54}:" CGColor]" |
| 26 |
|
| 27 |
// CHECK: {17:13-17:13}:"[" |
| 28 |
// CHECK: {17:31-17:31}:" CGColor]" |
| 29 |
|
| 30 |
// CHECK: {21:25-21:25}:"[" |
| 31 |
// CHECK: {21:45-21:45}:" CGColor]" |
| 32 |
|
| 33 |
@interface ImplicitPropertyTest |
| 34 |
- (UIColor *)tintColor; |
| 35 |
@end |
| 36 |
|
| 37 |
void test1(ImplicitPropertyTest *myImplicitPropertyTest) { |
| 38 |
CGColorRef cgColor = (CGColorRef)[myImplicitPropertyTest tintColor]; |
| 39 |
} |
| 40 |
|
| 41 |
// CHECK: {38:36-38:36}:"[" |
| 42 |
// CHECK: {38:70-38:70}:" CGColor]" |