1 // RUN: %clang_cc1 -arcmt-check -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -verify %s
3 typedef const void * CFTypeRef;
4 CFTypeRef CFBridgingRetain(id X);
5 id CFBridgingRelease(CFTypeRef);
8 CFTypeRef CFRetain(CFTypeRef cf);
18 + (id)stringWithFormat:(NSString *)format;
25 result = (id) CFRetain([NSString stringWithFormat:@"PBXLoopMode"]); // expected-error {{cast of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast}} \
26 // expected-note {{use __bridge to convert directly (no change in ownership)}} \
27 // expected-note {{use CFBridgingRelease call to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
29 result = (id) CFRetain((id)((objc_format))); // expected-error {{cast of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast}} \
30 // expected-note {{use __bridge to convert directly (no change in ownership)}} \
31 // expected-note {{use CFBridgingRelease call to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
33 result = (id) CFRetain((id)((cf_format))); // expected-error {{cast of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast}} \
34 // expected-note {{use __bridge to convert directly (no change in ownership)}} \
35 // expected-note {{use CFBridgingRelease call to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
37 result = (id) CFRetain((CFTypeRef)((objc_format)));
39 result = (id) CFRetain(cf_format); // OK