summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-14 12:01:15 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-14 12:01:15 +0000
commita1212c35003bd4ab215b2710a357346e6563488d (patch)
treea349501139d54b3f88650641cacf655a514a2bd1 /gcc/testsuite/g++.dg/other
parentc272d6a360d7bb873c18a01c75eda2d63616ee92 (diff)
downloadgcc-a1212c35003bd4ab215b2710a357346e6563488d.tar.gz
gcc/cp/ChangeLog:
PR c++/17816 * decl.c (redeclaration_error_message): Report redefinition of pure virtual function. gcc/testsuite/ChangeLog: PR c++/17816 * g++.dg/other/redecl2.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/other')
-rw-r--r--gcc/testsuite/g++.dg/other/redecl2.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/redecl2.C b/gcc/testsuite/g++.dg/other/redecl2.C
new file mode 100644
index 00000000000..591c258b891
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/redecl2.C
@@ -0,0 +1,11 @@
+// PR c++/17816
+// We failed to report duplicate definitions of pure virtual ns.
+
+// { dg-do compile }
+
+struct S {
+ virtual int foo() = 0;
+};
+
+int S::foo() { return 0; } // { dg-error "defined here" }
+int S::foo() { return 0; } // { dg-error "redefinition" }