blob: 9fedfc81223bef566e21e54edc836664bf9554b1 [file] [log] [blame]
/* APPLE LOCAL file radar 4815061 */
/* Warn when derived class restrics accessors; i.e. readwrite->readonly.
But do not warn when it expands; i.e. readonly->readwrite. */
/* { dg-options "-mmacosx-version-min=10.5 -fobjc-new-property" } */
/* { dg-do compile } */
@interface Mutable
@property(readwrite) int count;
@property(readwrite) int age;
@property(readonly) int year;
@end
@interface Immutable:Mutable
@property(readonly) int count;
@property(readwrite) int age;
@property(readwrite) int year;
@end /* { dg-warning "attribute \'readonly\' of property \'count\' restricts attribute \'readwrite\' of \'Mutable\' property in super class" } */
@protocol PMutable
@property(readwrite) int count;
@property(readwrite) int age;
@property(readonly) int year;
@end
@interface AlsoImmutable <PMutable>
@property(readonly) int count;
@property(readwrite) int age;
@property(readwrite) int year;
@end /* { dg-warning "attribute \'readonly\' of property \'count\' restricts attribute \'readwrite\' of \'PMutable\' property in protocol" } */
int main (void) {return 0;}