Issue A-24

Matt Austern austern at sgi.com
Wed Mar 15 23:24:45 UTC 2000


Jim and I have been thinking about Christophe's alternate proposal for
A-24.  It would be nice if the alternate works, because all of these
little id_proxy_ptr fields will be a nuisance.

I think it does work, provided that a __class_type_info for an
incomplete class can appear only as the end of a __pointer_type_info
chain.

The basic idea: as before, we add a new flag to __pointer_type_info,
in the same word as the cv-qualification flags.  This flag is 1 if
it's a pointer to an incomplete type, or a pointer to pointer to
incomplete type, etc.

We represent a pointer to incomplete class as a __pointer_type_info,
with the incomplete bit set, that points to a __class_type_info.
That __class_type_info contains the name of the incomplete class,
as usual.

(Christophe suggested a new class, __incomplete_class_info.  I see
no reason for it, though.  We don't need any information for
incomplete classes that we don't already have in __class_type_info.)

The __class_type_info for an incomplete type is mangled differently
than the typeinfo object for a complete type.  A __class_type_info
object for an incomplete type is static.  (As before, this is to make
sure a complete __class_type_info object in a DSO won't be overridden
by an incomplete __class_type_info object in an executable.)

To compare two pointers: if the incomplete flag is set in neither,
then we can use address equality of whatever lives at the end of the
__pointer_type_info chain.  If the incomplete flag is set in at least
one of them, then we use name equality to compare the types at the end
of the __pointer_type_info chain.

                        --Matt




More information about the cxx-abi-dev mailing list