summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/warning4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/warning4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/warning4.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/warning4.C b/gcc/testsuite/g++.old-deja/g++.jason/warning4.C
new file mode 100644
index 000000000..9f50ff2c2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/warning4.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// { dg-options "-Woverloaded-virtual" }
+// Bug: a virtual function with the same name in an unrelated class will
+// cause a bogus overloading warning.
+
+struct A {
+ virtual void foo ();
+};
+
+struct B {
+ virtual void bar ();
+};
+
+struct C: public A {
+ virtual void bar ();
+};