1 // Objective-C recovery 2 // RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s 3 // RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s 4 // RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c++ %s 2>&1 | FileCheck %s 5 // rdar://15499111 6 7 typedef struct __attribute__((objc_bridge_related(NSColor,colorWithCGColor:,CGColor))) CGColor *CGColorRef; 8 9 @interface NSColor 10 + (NSColor *)colorWithCGColor:(CGColorRef)cgColor; 11 - (CGColorRef)CGColor; 12 @end 13 14 @interface NSTextField 15 - (void)setBackgroundColor:(NSColor *)color; 16 - (NSColor *)backgroundColor; 17 @end 18 19 NSColor * Test1(NSTextField *textField, CGColorRef newColor) { 20 textField.backgroundColor = newColor; 21 return newColor; 22 } 23 24 CGColorRef Test2(NSTextField *textField, CGColorRef newColor) { 25 newColor = textField.backgroundColor; // [textField.backgroundColor CGColor] 26 return textField.backgroundColor; 27 } 28 // CHECK: {20:30-20:30}:"[NSColor colorWithCGColor:" 29 // CHECK: {20:38-20:38}:"]" 30 // CHECK: {21:9-21:9}:"[NSColor colorWithCGColor:" 31 // CHECK: {21:17-21:17}:"]" 32 // CHECK: {25:13-25:13}:"[" 33 // CHECK: {25:38-25:38}:" CGColor]" 34 // CHECK: {26:9-26:9}:"[" 35 // CHECK: {26:34-26:34}:" CGColor]" 36