Bug 17816 - duplicate definition of pure virtual function not diagnosed
Summary: duplicate definition of pure virtual function not diagnosed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Alexandre Oliva
URL:
Keywords: accepts-invalid, monitored, patch
Depends on:
Blocks:
 
Reported: 2004-10-03 19:44 UTC by Richard Henderson
Modified: 2005-02-14 15:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-02-09 13:06:51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Henderson 2004-10-03 19:44:28 UTC
struct S {
  virtual int foo() = 0;
};
 
int S::foo() { return 0; }
int S::foo() { return 0; }

Affects at least gcc 3.2 and forward.
Comment 1 Andrew Pinski 2004-10-03 19:46:36 UTC
Confirmed.
Comment 2 Volker Reichelt 2005-01-20 23:52:31 UTC
Fails since at least gcc 2.95.3.
Comment 3 Andrew Pinski 2005-02-09 14:36:41 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00351.html>.
Comment 4 CVS Commits 2005-02-14 12:01:29 UTC
Subject: Bug 17816

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aoliva@gcc.gnu.org	2005-02-14 12:01:16

Modified files:
	gcc/cp         : ChangeLog decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/other: redecl2.C 

Log message:
	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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4626&r2=1.4627
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1362&r2=1.1363
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5029&r2=1.5030
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/redecl2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 Andrew Pinski 2005-02-14 15:00:30 UTC
Fixed.