aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2005-02-14 12:01:15 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2005-02-14 12:01:15 +0000
commitd1fc3bbd80a4d4dff957b9eeb5ae463f3e8f55b1 (patch)
treea349501139d54b3f88650641cacf655a514a2bd1 /gcc/cp
parentaf9ecd0ca05832b2681965b96e0f169b19355f89 (diff)
downloadgcc-d1fc3bbd80a4d4dff957b9eeb5ae463f3e8f55b1.zip
gcc-d1fc3bbd80a4d4dff957b9eeb5ae463f3e8f55b1.tar.gz
gcc-d1fc3bbd80a4d4dff957b9eeb5ae463f3e8f55b1.tar.bz2
re PR c++/17816 (duplicate definition of pure virtual function not diagnosed)
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7e39ce1..777f520 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a93cdf8..47732cb 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1913,7 +1913,8 @@ redeclaration_error_message (tree newdecl, tree olddecl)
/* 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