blob: cc540f6431bd9cb3b2933807e1ab987587c33645 [file] [log] [blame]
Patrick Beardacfbe9e2012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fobjc-arc -verify -Wno-objc-root-class %s
John McCall31168b02011-06-15 23:02:42 +00002
3// rdar://problem/9150784
4void test(void) {
John McCallb61e14e2015-10-27 04:54:50 +00005 __weak id x; // expected-error {{cannot create __weak reference because the current deployment target does not support weak references}}
Jordan Rose96c496862012-07-19 18:10:18 +00006 __weak void *v; // expected-warning {{'__weak' only applies to Objective-C object or block pointer types}}
John McCall31168b02011-06-15 23:02:42 +00007}
8
9@interface A
10@property (weak) id testObjectWeakProperty; // expected-note {{declared here}}
11@end
12
13@implementation A
14// rdar://9605088
John McCallb61e14e2015-10-27 04:54:50 +000015@synthesize testObjectWeakProperty; // expected-error {{cannot synthesize weak property because the current deployment target does not support weak references}}
John McCall31168b02011-06-15 23:02:42 +000016@end