annotate clang/test/SemaObjC/error-property-gc-attr.m @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 @interface INTF
anatofuz
parents:
diff changeset
5 {
anatofuz
parents:
diff changeset
6 id IVAR; // expected-note {{instance variable is declared here}}
anatofuz
parents:
diff changeset
7 __weak id II;
anatofuz
parents:
diff changeset
8 __weak id WID;
anatofuz
parents:
diff changeset
9 id ID;
anatofuz
parents:
diff changeset
10 __weak INTF* AWEAK;
anatofuz
parents:
diff changeset
11 __weak INTF* WI;
anatofuz
parents:
diff changeset
12 }
anatofuz
parents:
diff changeset
13 @property (assign) __weak id pweak;
anatofuz
parents:
diff changeset
14 @property (assign) __weak id WID;
anatofuz
parents:
diff changeset
15 @property (assign) __strong id NOT;
anatofuz
parents:
diff changeset
16 @property (assign) id ID;
anatofuz
parents:
diff changeset
17 @property (assign) INTF* AWEAK;
anatofuz
parents:
diff changeset
18 @property (assign) __weak INTF* WI;
anatofuz
parents:
diff changeset
19 @end
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 @implementation INTF
anatofuz
parents:
diff changeset
22 @synthesize pweak=IVAR; // expected-error {{existing instance variable 'IVAR' for __weak property 'pweak' must be __weak}}
anatofuz
parents:
diff changeset
23 @synthesize NOT=II; // expected-error {{existing instance variable 'II' for strong property 'NOT' may not be __weak}}
anatofuz
parents:
diff changeset
24 @synthesize WID;
anatofuz
parents:
diff changeset
25 @synthesize ID;
anatofuz
parents:
diff changeset
26 @synthesize AWEAK; // expected-error {{existing instance variable 'AWEAK' for strong property 'AWEAK' may not be __weak}}
anatofuz
parents:
diff changeset
27 @synthesize WI;
anatofuz
parents:
diff changeset
28 @end