abi::__base_class_info's public_mask

Nathan Sidwell nathan at acm.org
Fri Aug 18 17:39:09 UTC 2000


"Jeffrey D. Oldham" wrote:
> 
> \S 2.9.5.6.c of the C++ ABI for IA-64 specifies that
> abi::__base_class_info has a __public_mask enumeration constant
> implying that __vmi_class_type_info has entries for non-public direct
> base classes.  Are these non-public base classes included just for
> completeness or are they necessary to implement dynamic_cast or some
> other algorithm?
They are necessary for dynamic_cast. See [5.2.7]/8 in the standard.
If a class has ambiguous base T, a dynamic cast to T can only succeed
if the original starting object is a base of exactly one of those T's.
Ambiguity is determined before access, so even if one of those T's is
private, it can still affect the cast (by making it fail). Private
bases are not of interest to dynamic cast, if it knows there are
no ambiguous bases (hence the diamond-shaped and repeated-bases flags).

> Am I correct in assuming that the \S 2.9.7 dynamic cast algorithm only
> looks at public base classes?
No.

Sorry, I'm about to nip off on holiday for a week -- any followup
will have to wait.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan at codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm.org




More information about the cxx-abi-dev mailing list