summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/weak-attr-ivar.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/weak-attr-ivar.m')
-rw-r--r--test/SemaObjC/weak-attr-ivar.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaObjC/weak-attr-ivar.m b/test/SemaObjC/weak-attr-ivar.m
index d5bbb01..e3d96da 100644
--- a/test/SemaObjC/weak-attr-ivar.m
+++ b/test/SemaObjC/weak-attr-ivar.m
@@ -72,3 +72,13 @@ typedef enum { Foo_HUH_NONE } FooHUHCode;
}
@end
+// rdar://problem/9123040
+@interface Test1 {
+@public
+ id ivar __attribute__((objc_gc(weak)));
+}
+@property (assign) id prop __attribute((objc_gc(weak)));
+@end
+void test1(Test1 *t) {
+ id *(__attribute__((objc_gc(strong))) x) = &t->ivar; // expected-warning {{initializing '__strong id *' with an expression of type '__weak id *' discards qualifiers}}
+}
OpenPOWER on IntegriCloud