[cxx-abi-dev] What is alignof(decltype(nullptr))?

Richard Smith richardsmith at google.com
Fri Apr 24 15:08:00 UTC 2015


On 23 April 2015 at 19:51, Dennis Handly <dhandly at cup.hp.com> wrote:

> >From: Richard Smith <richardsmith at google.com>
> >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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20150424/01a1be18/attachment.html>


More information about the cxx-abi-dev mailing list