xref: /aosp_15_r20/external/clang/test/SemaObjC/no-gc-weak-test.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
2*67e74705SXin Li
3*67e74705SXin Li@interface Subtask
4*67e74705SXin Li{
5*67e74705SXin Li  id _delegate;
6*67e74705SXin Li}
7*67e74705SXin Li@property(nonatomic,readwrite,assign)   id __weak       delegate;  // expected-error {{unsafe_unretained property 'delegate' may not also be declared __weak}}
8*67e74705SXin Li@end
9*67e74705SXin Li
10*67e74705SXin Li@implementation Subtask
11*67e74705SXin Li@synthesize delegate = _delegate;
12*67e74705SXin Li@end
13*67e74705SXin Li
14*67e74705SXin Li
15*67e74705SXin Li@interface PVSelectionOverlayView2
16*67e74705SXin Li{
17*67e74705SXin Li id __weak _selectionRect;  // expected-error {{cannot create __weak reference because the current deployment target does not support weak references}} expected-error {{existing instance variable '_selectionRect' for property 'selectionRect' with assign attribute must be __unsafe_unretained}}
18*67e74705SXin Li}
19*67e74705SXin Li
20*67e74705SXin Li@property(assign) id selectionRect; // expected-note {{property declared here}}
21*67e74705SXin Li
22*67e74705SXin Li@end
23*67e74705SXin Li
24*67e74705SXin Li@implementation PVSelectionOverlayView2
25*67e74705SXin Li
26*67e74705SXin Li@synthesize selectionRect = _selectionRect; // expected-note {{property synthesized here}}
27*67e74705SXin Li@end
28*67e74705SXin Li
29