[cxx-abi-dev] non-public non-static members vs POD layout
Mark Mitchell
mark at codesourcery.com
Tue Apr 29 15:28:48 UTC 2008
David Vandevoorde wrote:
>> 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?
>
> I think so. Hereunder is an e-mail to this list (from a few years ago)
> that seems to indicate we already agreed to use the TC1 definition of PODs.
Well, that's embarassing; clearly my memory is pathetic.
So, yes, we agreed to use TC1 PODs, and thus pointers-to-members are in.
In that case, yes, I think we have to say how they are laid out -- but
I think we already do.
For data members, we say that a pointer to data member is "represented
as a ptrdiff_t."
And for pointers to function members; we say that they have "the size,
data size, and alignment of a class containing these two members", after
saying what members they are. I think we could probably make that more
explicit by saying that they layout is as for the following class:
struct pointer_to_member {
void (*ptr)();
ptrdiff_t adj;
};
That would eliminate ambiguities. But, I think that's just an editorial
change. (Anyone object to that change? Or think it's a good idea?)
Thoughts?
--
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713
More information about the cxx-abi-dev
mailing list