On Fri, Apr 24, 2015 at 8:08 AM, Richard Smith <[email protected]>
wrote:

> On 23 April 2015 at 19:51, Dennis Handly <[email protected]> wrote:
>
>> >From: Richard Smith <[email protected]>
>> >but does not appear to place any requirements on
>> alignof(decltype(nullptr)).
>> >Itanium C++ ABI differ: Clang and EDG use alignof(void*). GCC uses 1.
>>
>> Was this intentional or just an oversight, confusing the alignment of the
>> pointer vs what it points to?
>>
>> >alignof(void*) seems like a better answer to me. Thoughts?
>>
>> Yes, all pointers should be aligned the same.  Unless there is short vs
>> far, types.
>>
>
> Well, nullptr_t is not a pointer. There's really no need for us to make it
> have the same size and alignment as any particular pointer type, but if we
> choose to do so it makes sense to be consistent.
>
>
nullptr_t may not be a pointer type, but everyone thinks of it as one.
I would go with the "principle of least astonishment" here, and say that it
should be aligned like a pointer.
(Especially since sizeof(nullptr_t) == sizeof(void *))

-- Marshall
_______________________________________________
cxx-abi-dev mailing list
[email protected]
http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev

Reply via email to