[cxx-abi-dev] trivial __dynamic_cast fails?

Daveed Vandevoorde daveed at edg.com
Fri Feb 27 21:10:18 UTC 2004


On Feb 27, 2004, at 12:36 PM, Mark Mitchell wrote:

> David Baraff wrote:
>
>> I'm playing around with the __cxxabiv1::__dynamic_cast() function.  It
>> works as I would expect, with one exception.
>
> The ABI document does not require that __dynamic_cast perform a 
> derived-to-base cast.  Those __dynamic_cast operations that can 
> actually be performed statically by the compiler must be performed 
> statically by the compiler -- the runtime library does not expect to 
> be called in that situation.

Indeed.  However, it is not the first time I
encounter the desire to be able to do this
sort of thing.  Since the ABI specs do not
currently say what __dynamic_cast should do
in the cases that the compiler handles alone,
I don't think there would be a significant
backward compatibility issue in trying to
support a useful design technique.  If it
can be done within the framework of the
existing RTTI structures, I think it would
be worth "upgrading" __dynamic_cast to
address this.

There has been occasional talk among WG21/
J16 actives about adding a facility like
what David B. is looking for, but so far
no concrete proposals.  I'm going to CC
David Abrahams who mentioned the desire
for this once.  Perhaps he has some insight
into how widespread the need for this is.

	Daveed




More information about the cxx-abi-dev mailing list