llvm-project/clang/test/SemaObjC/property-implement-readonly-with-custom-setter.m
Alex Lorenz 05a63ee197 [ObjC] Don't warn on readwrite properties with custom setters that
override readonly properties from protocols

rdar://34192541

llvm-svn: 315093
2017-10-06 19:24:26 +00:00

22 lines
694 B
Objective-C

// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://34192541
@class NSString;
@protocol MyProtocol
@property (nonatomic, strong, readonly) NSString *myString;
@end
@interface MyClass <MyProtocol>
// Don't warn about this setter:
@property (nonatomic, strong, setter=setMYString:) NSString *myString;
@property (nonatomic, strong, readonly) NSString *overridenInClass; // expected-note {{property declared here}}
@end
@interface MySubClass: MyClass
@property (nonatomic, strong, setter=setMYOverride:) NSString *overridenInClass;
// expected-warning@-1 {{'setter' attribute on property 'overridenInClass' does not match the property inherited from 'MyClass'}}
@end