annotate clang/test/SemaObjC/property-impl-misuse.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 I {
anatofuz
parents:
diff changeset
4 int Y;
anatofuz
parents:
diff changeset
5 }
anatofuz
parents:
diff changeset
6 @property int X;
anatofuz
parents:
diff changeset
7 @property int Y;
anatofuz
parents:
diff changeset
8 @property int Z;
anatofuz
parents:
diff changeset
9 @end
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 @implementation I
anatofuz
parents:
diff changeset
12 @dynamic X; // expected-note {{previous declaration is here}}
anatofuz
parents:
diff changeset
13 @dynamic X; // expected-error {{property 'X' is already implemented}}
anatofuz
parents:
diff changeset
14 @synthesize Y; // expected-note {{previous use is here}}
anatofuz
parents:
diff changeset
15 @synthesize Z=Y; // expected-error {{synthesized properties 'Z' and 'Y' both claim instance variable 'Y'}}
anatofuz
parents:
diff changeset
16 @end
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 // rdar://8703553
anatofuz
parents:
diff changeset
19 @interface IDEPathCell
anatofuz
parents:
diff changeset
20 {
anatofuz
parents:
diff changeset
21 @private
anatofuz
parents:
diff changeset
22 id _gradientStyle;
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 @property (readwrite, assign, nonatomic) id gradientStyle;
anatofuz
parents:
diff changeset
26 @end
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 @implementation IDEPathCell
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 @synthesize gradientStyle = _gradientStyle;
anatofuz
parents:
diff changeset
31 - (void)setGradientStyle:(id)value { }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 + (id)_componentCellWithRepresentedObject {
anatofuz
parents:
diff changeset
34 return self.gradientStyle;
anatofuz
parents:
diff changeset
35 }
anatofuz
parents:
diff changeset
36 @end
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 // rdar://11054153
anatofuz
parents:
diff changeset
39 @interface rdar11054153
anatofuz
parents:
diff changeset
40 @property int P; // expected-error {{type of property 'P' ('int') does not match type of accessor 'P' ('void')}}
anatofuz
parents:
diff changeset
41 - (void)P; // expected-note {{declared here}}
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43 @property int P1; // expected-warning {{type of property 'P1' does not match type of accessor 'P1'}}
anatofuz
parents:
diff changeset
44 - (double) P1; // expected-note {{declared here}}
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 @property int P2; // expected-error {{type of property 'P2' ('int') does not match type of accessor 'P2' ('double *')}}
anatofuz
parents:
diff changeset
47 - (double*)P2; // expected-note {{declared here}}
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 @end