diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2005-02-14 12:01:15 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2005-02-14 12:01:15 +0000 |
commit | c25b756f55fb46bc85168b4ec28ac666ee9eb156 (patch) | |
tree | a349501139d54b3f88650641cacf655a514a2bd1 /gcc/cp/decl.c | |
parent | 66e712ec188213ab2a5f174cc50ceb3c1fb1434a (diff) |
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: https://gcc.gnu.org/svn/gcc/trunk@95008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a93cdf8f4c1..47732cb6bc8 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 |