aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/method-18.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/method-18.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/method-18.mm26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/method-18.mm b/gcc/testsuite/obj-c++.dg/method-18.mm
new file mode 100644
index 00000000000..1035553dcc4
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-18.mm
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file mainline */
+/* Contributed by Igor Seleznev <selez@mail.ru>. */
+/* This used to be broken. */
+
+#include <objc/objc.h>
+
+@interface A
++ (A *)currentContext;
+@end
+
+@interface B
++ (B *)currentContext;
+@end
+
+int main()
+{
+ [A currentContext]; /* { dg-bogus "multiple declarations" } */
+ return 0;
+}
+
+@implementation A
++ (A *)currentContext { return nil; }
+@end
+@implementation B
++ (B *)currentContext { return nil; }
+@end