1 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi %s 2 3 typedef int BOOL; 4 typedef const struct __CFString * CFStringRef; 5 6 @class NSString; 7 8 void f(BOOL b) { 9 CFStringRef cfstr; 10 NSString *str = (NSString *)cfstr; // expected-error {{cast of C pointer type 'CFStringRef' (aka 'const struct __CFString *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \ 11 // expected-note{{use __bridge to convert directly (no change in ownership)}} \ 12 // expected-note{{use __bridge_transfer to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}} 13 void *vp = str; // expected-error {{disallowed}} 14 } 15