summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/arm2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/arm2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/arm2.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/arm2.C b/gcc/testsuite/g++.old-deja/g++.brendan/arm2.C
new file mode 100644
index 000000000..fb1ee429d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/arm2.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// GROUPS passed ARM-compliance
+// ARM 9.4 ``There cannot be a static and a nonstatic member function
+// with the same name and the same argument types.''
+//
+// The trick is to make sure it's caught with both orders (static,
+// then normal, and vice-versa.
+
+class X {
+public:
+ int foo(); // { dg-error "with" }
+ static int foo(); // error: redeclaration// { dg-error "overloaded" } .*
+};
+
+class Y {
+public:
+ static int foo(); // { dg-error "with" }
+ int foo(); // error: redeclaration// { dg-error "overloaded" } .*
+};