This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: dynamic_cast behavior differs from standard?
- To: jbuck at Synopsys dot COM
- Subject: Re: dynamic_cast behavior differs from standard?
- From: David Mazieres <dm at reeducation-labor dot lcs dot mit dot edu>
- Date: Tue, 23 Feb 1999 20:12:47 -0500 (EST)
- CC: egcs at cygnus dot com
- References: <199902240052.QAA02836@atrus.synopsys.com>
> From: Joe Buck <jbuck@Synopsys.COM>
> Date: Tue, 23 Feb 99 16:52:34 PST
>
> The place to ask such question is on comp.std.c++, where you're likely
> to get answers from the people who actually wrote the standard.
>
> The fact that you say that all the other compilers are doing exactly
> what egcs is doing suggest that it is your reading rather than the
> compiler that is wrong. (Though of course it's possible that all the
> implementers are making the same mistake).
Consider my message a bug report. I don't want to say "hey, go
implement this change" if there's any chance I could be wrong. I am
pretty sure this is a bug in egcs, though--sure enough that I think
it's worth filing a bug report. Since I'm not exactly 100% sure,
though, I think it's also fair for me to say "but I could be wrong.
Here's some language from the standard. Don't consider this a bug
report if there is some other possible interpretation." Maybe I
sounded too willing to accept the blame for misreading the standard
because I was trying to be polite.
At any rate, even if the standard can somehow be interpreted to say
that regular, compile-time, access control also applies to
dynamic_cast, I still think the example code I included indicates a
bug in egcs. (I didn't get into this in the previous mail because I
don't know exactly how this interpretation of the standard would come
about).
I'm sending this to egcs because the egcs developers actually seem to
pay attention to bug reports. If I thought that was true of other
compiler vendors, I'd send them the bug report too. If I saw any
ambiguity in the standard, I would post to comp.std.c++, but I don't.
The standard seems pretty clear. (The word "friend" does not even
appear anywhere in section 5). Since all the non-egcs compilers I
have access to are probably pre-standard, I suspect this may have been
a late change to the standard.
David