diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-01 22:56:20 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-01 22:56:20 +0000 |
| commit | 30febeb224e0f76ed225e4b1c05e0970b113f1b6 (patch) | |
| tree | b7b2ba53459db212754a3842a0331f2e3315ad57 /clang/test/ARCMT/nonobjc-to-objc-cast-2.m | |
| parent | 3441597f84e8c025eff4c65c3f82c1c0ffa3f764 (diff) | |
| download | bcm5719-llvm-30febeb224e0f76ed225e4b1c05e0970b113f1b6.tar.gz bcm5719-llvm-30febeb224e0f76ed225e4b1c05e0970b113f1b6.zip | |
Look for declaration of CFBridgingRetain/CFBridgingRetain before
changing the diagnostic. Also use correct spelling for both.
llvm-svn: 149554
Diffstat (limited to 'clang/test/ARCMT/nonobjc-to-objc-cast-2.m')
| -rw-r--r-- | clang/test/ARCMT/nonobjc-to-objc-cast-2.m | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/test/ARCMT/nonobjc-to-objc-cast-2.m b/clang/test/ARCMT/nonobjc-to-objc-cast-2.m index 52d635b531b..1ec0089f08e 100644 --- a/clang/test/ARCMT/nonobjc-to-objc-cast-2.m +++ b/clang/test/ARCMT/nonobjc-to-objc-cast-2.m @@ -9,13 +9,16 @@ @end typedef const struct __CFString * CFStringRef; +typedef const void * CFTypeRef; +CFTypeRef CFBridgingRetain(id X); +id CFBridgingRelease(CFTypeRef); void f(BOOL b) { CFStringRef cfstr; 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}} \ // expected-note{{use __bridge to convert directly (no change in ownership)}} \ - // expected-note{{use CFBridgeRelease call to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}} - void *vp = str; // expected-error {{requires a bridged cast}} expected-note {{use CFBridgeRetain call}} expected-note {{use __bridge}} + // expected-note{{use CFBridgingRelease call to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}} + void *vp = str; // expected-error {{requires a bridged cast}} expected-note {{use CFBridgingRetain call}} expected-note {{use __bridge}} } void f2(NSString *s) { @@ -23,7 +26,7 @@ void f2(NSString *s) { ref = [(CFStringRef)[s string] retain]; // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast}} \ // expected-error {{bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \ // expected-note{{use __bridge to convert directly (no change in ownership)}} \ - // expected-note{{use CFBridgeRetain call to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}} + // expected-note{{use CFBridgingRetain call to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}} } CFStringRef f3() { |

