This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13664] New: virtual in private base can be overridden in further-derived class
- From: "james_avera2 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2004 00:37:11 -0000
- Subject: [Bug c++/13664] New: virtual in private base can be overridden in further-derived class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In gcc 3.2.3 (linux) a virtual method in a distant private base can be
over-ridden. Since the base is private to the intermediate class, its
fields should be invisible to further-derived classes.
I guess I'm not *certain* this is a bug, but the argument goes like this:
Since the base is private, it should be completely opaque to
further-derived classes; in particular, further-derived classes should not
have their namespace polluted, nor should their methods accidentally
override methods of the private base of the intermediate base.
In fact, gcc 3.2.2 (linux) does allow a further-derived class to override
virtuals in a private base of an intermediate base. It should either
treat them as independent methods or disallow re-use of the same name.
I'll attach a demo program.
--
Summary: virtual in private base can be overridden in further-
derived class
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: james_avera2 at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13664