summaryrefslogtreecommitdiffstats
path: root/test/SemaObjCXX/arc-unavailable-for-weakref.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjCXX/arc-unavailable-for-weakref.mm')
-rw-r--r--test/SemaObjCXX/arc-unavailable-for-weakref.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/SemaObjCXX/arc-unavailable-for-weakref.mm b/test/SemaObjCXX/arc-unavailable-for-weakref.mm
index 24593ce..2a80aeb 100644
--- a/test/SemaObjCXX/arc-unavailable-for-weakref.mm
+++ b/test/SemaObjCXX/arc-unavailable-for-weakref.mm
@@ -15,7 +15,8 @@ int main() {
id obj;
ns1 = (__weak sub *)obj; // expected-error {{assignment of a weak-unavailable object to a __weak object}} \
- // expected-error {{class is incompatible with __weak references}}
+ // expected-error {{class is incompatible with __weak references}} \
+ // expected-error {{explicit ownership qualifier on cast result has no effect}}
}
// rdar://9732636
@@ -30,7 +31,8 @@ NOWEAK * Test1() {
weak1 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
__weak id weak2 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
- return (__weak id)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK *' to a __weak object of type '__weak id'}}
+ return (__weak id)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK *' to a __weak object of type '__weak id'}} \
+ // expected-error {{explicit ownership qualifier on cast result has no effect}}
}
@protocol P @end
@@ -42,6 +44,7 @@ NOWEAK<P, P1> * Test2() {
weak1 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
__weak id<P> weak2 = strong1; // expected-error {{assignment of a weak-unavailable object to a __weak object}}
- return (__weak id<P, P1>)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK<P,P1> *' to a __weak object of type '__weak id<P,P1>'}}
+ return (__weak id<P, P1>)strong1; // expected-error {{cast of weak-unavailable object of type 'NOWEAK<P,P1> *' to a __weak object of type '__weak id<P,P1>'}} \
+ // expected-error {{explicit ownership qualifier on cast result has no effect}}
}
OpenPOWER on IntegriCloud