From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../obj-c++.dg/property/at-property-16.mm | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 gcc/testsuite/obj-c++.dg/property/at-property-16.mm (limited to 'gcc/testsuite/obj-c++.dg/property/at-property-16.mm') diff --git a/gcc/testsuite/obj-c++.dg/property/at-property-16.mm b/gcc/testsuite/obj-c++.dg/property/at-property-16.mm new file mode 100644 index 000000000..6a9856b90 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/property/at-property-16.mm @@ -0,0 +1,46 @@ +/* Contributed by Nicola Pero , November 2010. */ +/* { dg-do compile } */ + +#include + +/* Test that if you have a property declared in a class and a + sub-class, the attributes match. */ + +@interface MyRootClass +{ + Class isa; +} +@property (assign) id a; /* { dg-message "originally specified here" } */ +@property (retain) id b; /* { dg-message "originally specified here" } */ +@property int c; /* { dg-message "originally specified here" } */ +@property (nonatomic) int d; /* { dg-message "originally specified here" } */ +@property int e; /* { dg-message "originally specified here" } */ +@property int f; /* { dg-message "originally specified here" } */ +@property int g; /* { dg-message "originally specified here" } */ +@property (readonly) int h; /* Ok */ +@property (readonly,getter=getMe) int i; /* { dg-message "originally specified here" } */ +@end + +@interface MyClass : MyRootClass +@property (assign) id a; +@property (retain) id b; +@property int c; +@property (nonatomic) int d; +@property int e; +@property int f; +@property int g; +@property (readonly) int h; +@property (readonly,getter=getMe) int i; +@end + +@interface MyClass2 : MyRootClass +@property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */ +@property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */ +@property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */ +@property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */ +@property (setter=setX:) int e; /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */ +@property (getter=x) int f; /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */ +@property (readonly) int g; /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */ +@property (readwrite) int h; /* Ok */ +@property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */ +@end -- cgit v1.2.3