annotate clang/test/SemaObjC/continuation-class-err.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 -verify -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 @interface ReadOnly
anatofuz
parents:
diff changeset
4 {
anatofuz
parents:
diff changeset
5 id _object;
anatofuz
parents:
diff changeset
6 id _object1;
anatofuz
parents:
diff changeset
7 }
anatofuz
parents:
diff changeset
8 @property(readonly) id object;
anatofuz
parents:
diff changeset
9 @property(readwrite, assign) id object1; // expected-note {{property declared here}}
anatofuz
parents:
diff changeset
10 @property (readonly) int indentLevel;
anatofuz
parents:
diff changeset
11 @end
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 @interface ReadOnly ()
anatofuz
parents:
diff changeset
14 @property(readwrite, copy) id object; // Ok. declaring memory model in class extension - primary has none.
anatofuz
parents:
diff changeset
15 @property(readonly) id object1; // expected-error {{illegal redeclaration of property in class extension 'ReadOnly' (attribute must be 'readwrite', while its primary must be 'readonly')}}
anatofuz
parents:
diff changeset
16 @property (readwrite, assign) int indentLevel; // OK. assign the default in any case.
anatofuz
parents:
diff changeset
17 @end
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 @protocol Proto
anatofuz
parents:
diff changeset
20 @property (copy) id fee; // expected-note {{property declared here}}
anatofuz
parents:
diff changeset
21 @end
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 @protocol Foo<Proto>
anatofuz
parents:
diff changeset
24 @property (copy) id foo; // expected-note {{property declared here}}
anatofuz
parents:
diff changeset
25 @end
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 @interface Bar <Foo> {
anatofuz
parents:
diff changeset
28 id _foo;
anatofuz
parents:
diff changeset
29 id _fee;
anatofuz
parents:
diff changeset
30 }
anatofuz
parents:
diff changeset
31 @end
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 @interface Bar ()
anatofuz
parents:
diff changeset
34 @property (copy) id foo; // expected-error {{illegal redeclaration of property in class extension 'Bar' (attribute must be 'readwrite', while its primary must be 'readonly')}}
anatofuz
parents:
diff changeset
35 @property (copy) id fee; // expected-error {{illegal redeclaration of property in class extension 'Bar' (attribute must be 'readwrite', while its primary must be 'readonly')}}
anatofuz
parents:
diff changeset
36 @end
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 @implementation Bar
anatofuz
parents:
diff changeset
39 @synthesize foo = _foo;
anatofuz
parents:
diff changeset
40 @synthesize fee = _fee;
anatofuz
parents:
diff changeset
41 @end
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43 // rdar://10752081
anatofuz
parents:
diff changeset
44 @interface MyOtherClass() // expected-error {{cannot find interface declaration for 'MyOtherClass'}}
anatofuz
parents:
diff changeset
45 {
anatofuz
parents:
diff changeset
46 id array;
anatofuz
parents:
diff changeset
47 }
anatofuz
parents:
diff changeset
48 @end
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 @implementation MyOtherClass // expected-warning {{cannot find interface declaration for 'MyOtherClass'}}
anatofuz
parents:
diff changeset
51 @end