[cxx-abi-dev] non-public non-static members vs POD layout

Mark Mitchell mark at codesourcery.com
Mon Apr 28 22:59:54 UTC 2008


Scott --

My personal opinion is that the ABI does not guarantee that "almost"  
PODs are laid out as PODs. In fact I think it says that such things  
must be laid out using the rules in the C++ ABI -- surprising though  
that might be.

Also since the ABI predates TC1, the inclusion of pointers to members  
on PODs should not apply. I suppose the spec would explicitly say  
"PODs as defined prior to TC1"

Does anyone object to making that change?

--
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713

On Apr 16, 2008, at 2:34 AM, scott douglass <scott.douglass at arm.com>  
wrote:

> Hi,
>
> If a class or union has non-public non-static members it is non-POD
> (because it's not an 'aggregate' in 8.5.1).
>
> The C++ ABI (2.2) delegates layout of PODs to the base (C) ABI and
> specifies layout of of POD types itself.
>
> Does/should the C++ ABI guarantee than a class that is non-POD only
> because of non-public non-static members has the same layout as the
> corresponding POD class in cases where any tail-padding cannot be
> reused?  (Is base-class subobject the only case where tail-padding can
> be reused?)
>
> Also, a minor quibble:  since TC1 PODs can contain pointer-to-members
> and the base (C) ABI determines their layout, should it be mentioned
> more explicitly in 2.2 how they are layed out (as is done for 'bool').
>
> Thanks.
>
>
> -- 
> IMPORTANT NOTICE: The contents of this email and any attachments are  
> confidential and may also be privileged. If you are not the intended  
> recipient, please notify the sender immediately and do not disclose  
> the contents to any other person, use it for any purpose, or store  
> or copy the information in any medium.  Thank you.
>
>



More information about the cxx-abi-dev mailing list