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.
From-SVN: r95008
+2005-02-14 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17816
+ * decl.c (redeclaration_error_message): Report redefinition of
+ pure virtual function.
+
2005-02-11 Nathan Sidwell <nathan@codesourcery.com>
PR c++/19891
/* If this is a pure function, its olddecl will actually be
the original initialization to `0' (which we force to call
abort()). Don't complain about redefinition in this case. */
- if (DECL_LANG_SPECIFIC (olddecl) && DECL_PURE_VIRTUAL_P (olddecl))
+ if (DECL_LANG_SPECIFIC (olddecl) && DECL_PURE_VIRTUAL_P (olddecl)
+ && DECL_INITIAL (olddecl) == NULL_TREE)
return 0;
/* If both functions come from different namespaces, this is not
+2005-02-14 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17816
+ * g++.dg/other/redecl2.C: New.
+
2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
PR c++/19891
--- /dev/null
+// 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" }