This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix std::experimental::any for small, non-trivial objects


2015-05-02 19:33 GMT+02:00 Jonathan Wakely <jwakely@redhat.com>:
> Looking at it now, I think the _Internal alias template should also
> check that alignof(_Tp) <= alignof(void*) so that it can safely be
> stored in the _Storage.
>
> Otherwise a type with sizeof(T) <= sizeof(void*) but
> alignof(T) > alignof(void*) would not be correctly aligned when stored
> in the buffer.

Yes, I agree.

- Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]