aboutsummaryrefslogtreecommitdiff
path: root/test/ARCMT
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-31 23:42:37 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-31 23:42:37 +0000
commit7eb82f0d094d7180e7dee4fdea6a276c5febf81b (patch)
tree821b028502a2045ec604c5a1ea4ad84dba6e755a /test/ARCMT
parent3df61308ddfbdba0897b762a129b5a38750c87d0 (diff)
objc-arc: In various diagnostics mention
CFBridgingRetain/CFBridgingRelease calls instead of __bridge_retained/__bridge_transfer casts as preferred way of moving cf objects to arc land. // rdar://10207950 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ARCMT')
-rw-r--r--test/ARCMT/checking.m6
-rw-r--r--test/ARCMT/no-canceling-bridge-to-bridge-cast.m6
-rw-r--r--test/ARCMT/nonobjc-to-objc-cast-2.m6
3 files changed, 9 insertions, 9 deletions
diff --git a/test/ARCMT/checking.m b/test/ARCMT/checking.m
index 9bb142cda8..c9b4bf13c8 100644
--- a/test/ARCMT/checking.m
+++ b/test/ARCMT/checking.m
@@ -95,7 +95,7 @@ void test1(A *a, BOOL b, struct UnsafeS *unsafeS) {
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 __bridge_transfer to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}} \
+ // expected-note {{use CFBridgeRelease call to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}} \
str = (NSString *)kUTTypePlainText;
str = b ? kUTTypeRTF : kUTTypePlainText;
str = (NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
@@ -153,10 +153,10 @@ void * cvt(id arg)
(void)(void*)voidp_val;
(void)(void**)arg; // expected-error {{disallowed}}
cvt((void*)arg); // expected-error 2 {{requires a bridged cast}} \
- // expected-note 2 {{use __bridge to}} expected-note {{use __bridge_transfer}} expected-note {{use __bridge_retained}}
+ // expected-note 2 {{use __bridge to}} expected-note {{use CFBridgeRelease call}} expected-note {{use CFBridgeRetain call}}
cvt(0);
(void)(__strong id**)(0);
- return arg; // expected-error {{requires a bridged cast}} expected-note {{use __bridge}} expected-note {{use __bridge_retained}}
+ return arg; // expected-error {{requires a bridged cast}} expected-note {{use __bridge}} expected-note {{use CFBridgeRetain call}}
}
diff --git a/test/ARCMT/no-canceling-bridge-to-bridge-cast.m b/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
index 164b84b892..fefa3aea63 100644
--- a/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
+++ b/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
@@ -23,15 +23,15 @@ CFTypeRef CFRetain(CFTypeRef cf);
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}} \
// expected-note {{use __bridge to convert directly (no change in ownership)}} \
- // expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
+ // expected-note {{use CFBridgeRelease call to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
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}} \
// expected-note {{use __bridge to convert directly (no change in ownership)}} \
- // expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
+ // expected-note {{use CFBridgeRelease call to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
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}} \
// expected-note {{use __bridge to convert directly (no change in ownership)}} \
- // expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
+ // expected-note {{use CFBridgeRelease call to transfer ownership of a +1 'CFTypeRef' (aka 'const void *') into ARC}}
result = (id) CFRetain((CFTypeRef)((objc_format)));
diff --git a/test/ARCMT/nonobjc-to-objc-cast-2.m b/test/ARCMT/nonobjc-to-objc-cast-2.m
index 4c49b6039e..52d635b531 100644
--- a/test/ARCMT/nonobjc-to-objc-cast-2.m
+++ b/test/ARCMT/nonobjc-to-objc-cast-2.m
@@ -14,8 +14,8 @@ 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 __bridge_transfer 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 __bridge}} expected-note {{use __bridge}}
+ // 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}}
}
void f2(NSString *s) {
@@ -23,7 +23,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 __bridge_retained to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}}
+ // expected-note{{use CFBridgeRetain call to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}}
}
CFStringRef f3() {