This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16147] dynamic_cast fails to enforce accesssibility
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2004 20:22:20 -0000
- Subject: [Bug c++/16147] dynamic_cast fails to enforce accesssibility
- References: <20040622225853.16147.gdr@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-08-29 20:22 -------
Subject: Re: dynamic_cast fails to enforce accesssibility
"nathan at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| A need not be a public base of the most derived object. (In this
| hierarchy) it needs to be a public base of a B object, which it is.
| Therefore the dynamic cast succeeds and the assert fails.
| [5.2.7]/8 first bullet. 'v' is the A base, 'T' is the B base.
I don't think that the first bullet saysthe dynamic cast should succeed.
The most derived object here is of type C, not B.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16147