annotate clang/test/SemaObjC/custom-atomic-property.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 -fsyntax-only -Wcustom-atomic-properties -verify -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 @interface Foo
anatofuz
parents:
diff changeset
4 @property (assign) Foo *myProp; // expected-note {{property declared here}} expected-note {{property declared here}}
anatofuz
parents:
diff changeset
5 @end
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 @implementation Foo
anatofuz
parents:
diff changeset
8 -(Foo*)myProp {return 0;} // expected-warning {{atomic by default property 'myProp' has a user defined getter (property should be marked 'atomic' if this is intended)}}
anatofuz
parents:
diff changeset
9 -(void)setMyProp:(Foo*)e {} // expected-warning {{atomic by default property 'myProp' has a user defined setter (property should be marked 'atomic' if this is intended)}}
anatofuz
parents:
diff changeset
10 @end
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 @interface Foo2 {
anatofuz
parents:
diff changeset
13 Foo *myProp;
anatofuz
parents:
diff changeset
14 }
anatofuz
parents:
diff changeset
15 @property (assign) Foo *myProp;
anatofuz
parents:
diff changeset
16 @end
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 @implementation Foo2
anatofuz
parents:
diff changeset
19 @synthesize myProp; // no warnings.
anatofuz
parents:
diff changeset
20 @end