aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/arc-objc-lifetime.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/arc-objc-lifetime.m')
-rw-r--r--test/SemaObjC/arc-objc-lifetime.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/SemaObjC/arc-objc-lifetime.m b/test/SemaObjC/arc-objc-lifetime.m
index 19073c08c0..2318fbfccd 100644
--- a/test/SemaObjC/arc-objc-lifetime.m
+++ b/test/SemaObjC/arc-objc-lifetime.m
@@ -17,12 +17,14 @@ typedef __autoreleasing NSString * AUTORELEASEPNSString;
- (CFStringRef)myString
{
CFStringRef myString =
- (__bridge CFStringRef) (__strong NSString *)CFBridgingRelease(); // expected-error {{casting expression of type 'NSString *' to type 'NSString *__strong' with qualified lifetimewill not change object lifetime}}
+ (__bridge CFStringRef) (__strong NSString *)CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result would have no effect}}
myString =
- (__bridge CFStringRef) (__autoreleasing PNSString) CFBridgingRelease(); // expected-error {{casting expression of type 'NSString *' to type '__autoreleasing PNSString' (aka 'NSString *__autoreleasing') with qualified lifetimewill not change object}}
+ (__bridge CFStringRef) (__autoreleasing PNSString) CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result would have no effect}}
myString =
(__bridge CFStringRef) (AUTORELEASEPNSString) CFBridgingRelease(); // OK
+ myString =
+ (__bridge CFStringRef) (typeof(__strong NSString *)) CFBridgingRelease(); // expected-error {{explicit ownership qualifier on cast result would have no effect}}
return myString;
}