xref: /aosp_15_r20/external/clang/test/SemaObjC/arc-no-runtime.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -fobjc-arc -verify -Wno-objc-root-class %s
2*67e74705SXin Li
3*67e74705SXin Li// rdar://problem/9150784
4*67e74705SXin Livoid test(void) {
5*67e74705SXin Li  __weak id x; // expected-error {{cannot create __weak reference because the current deployment target does not support weak references}}
6*67e74705SXin Li  __weak void *v; // expected-warning {{'__weak' only applies to Objective-C object or block pointer types}}
7*67e74705SXin Li}
8*67e74705SXin Li
9*67e74705SXin Li@interface A
10*67e74705SXin Li@property (weak) id testObjectWeakProperty; // expected-note {{declared here}}
11*67e74705SXin Li@end
12*67e74705SXin Li
13*67e74705SXin Li@implementation A
14*67e74705SXin Li// rdar://9605088
15*67e74705SXin Li@synthesize testObjectWeakProperty; // expected-error {{cannot synthesize weak property because the current deployment target does not support weak references}}
16*67e74705SXin Li@end
17