diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/naming-2.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/naming-2.mm | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/naming-2.mm b/gcc/testsuite/obj-c++.dg/naming-2.mm new file mode 100644 index 00000000000..4b7860e10dd --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/naming-2.mm @@ -0,0 +1,40 @@ +/* Testing for detecting duplicate ivars. */ +/* { dg-do compile } */ + +typedef struct S { int i; } NSDictionary; + +@interface A +{ + NSDictionary * _userInfo; + int i1; + int i2; + int i3; + int i4; + int i5; + int i6; + int i7; +} +@end + +@interface B : A +{ + NSDictionary * _userInfo; /* { dg-error "duplicate member" } */ + int ii1; + int ii2; + int ii3; + int ii4; + int ii5; + int ii6; + int ii7; +} +@end + +@interface C : A +@end + +@interface D : C +{ + NSDictionary * _userInfo; /* { dg-error "duplicate member" } */ +} +@end + |