summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/naming-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/naming-1.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/naming-1.mm26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/naming-1.mm b/gcc/testsuite/obj-c++.dg/naming-1.mm
new file mode 100644
index 00000000000..aed2fd517af
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/naming-1.mm
@@ -0,0 +1,26 @@
+/* Testing for detecting duplicate ivars. */
+/* { dg-do compile } */
+
+typedef struct S { int i; } NSDictionary;
+
+@interface A
+{
+ NSDictionary * _userInfo;
+}
+@end
+
+@interface B : A
+{
+ NSDictionary * _userInfo; /* { dg-error "duplicate member" } */
+}
+@end
+
+@interface C : A
+@end
+
+@interface D : C
+{
+ NSDictionary * _userInfo; /* { dg-error "duplicate member" } */
+}
+@end
+