aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/nullable-weak-property.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/nullable-weak-property.m')
-rw-r--r--test/SemaObjC/nullable-weak-property.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaObjC/nullable-weak-property.m b/test/SemaObjC/nullable-weak-property.m
new file mode 100644
index 000000000000..617ff4ee5c62
--- /dev/null
+++ b/test/SemaObjC/nullable-weak-property.m
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnullable-to-nonnull-conversion %s -verify
+
+
+// rdar://19985330
+@interface NSObject @end
+
+@class NSFoo;
+void foo (NSFoo * __nonnull);
+
+@interface NSBar : NSObject
+@property(weak) NSFoo *property1;
+@end
+
+@implementation NSBar
+- (void) Meth {
+ foo (self.property1); // expected-warning {{implicit conversion from nullable pointer 'NSFoo * __nullable' to non-nullable pointer type 'NSFoo * __nonnull'}}
+}
+@end