annotate clang/test/SemaObjC/property-implement-readonly-with-custom-setter.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 // rdar://34192541
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 @class NSString;
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 @protocol MyProtocol
anatofuz
parents:
diff changeset
7 @property (nonatomic, strong, readonly) NSString *myString;
anatofuz
parents:
diff changeset
8 @end
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 @interface MyClass <MyProtocol>
anatofuz
parents:
diff changeset
11 // Don't warn about this setter:
anatofuz
parents:
diff changeset
12 @property (nonatomic, strong, setter=setMYString:) NSString *myString;
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 @property (nonatomic, strong, readonly) NSString *overridenInClass; // expected-note {{property declared here}}
anatofuz
parents:
diff changeset
16 @end
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 @interface MySubClass: MyClass
anatofuz
parents:
diff changeset
19 @property (nonatomic, strong, setter=setMYOverride:) NSString *overridenInClass;
anatofuz
parents:
diff changeset
20 // expected-warning@-1 {{'setter' attribute on property 'overridenInClass' does not match the property inherited from 'MyClass'}}
anatofuz
parents:
diff changeset
21 @end