This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix std::experimental::any for small, non-trivial objects
- From: Daniel Krügler <daniel dot kruegler at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 2 May 2015 19:51:03 +0200
- Subject: Re: [patch] Fix std::experimental::any for small, non-trivial objects
- Authentication-results: sourceware.org; auth=none
- References: <20150502123920 dot GW3618 at redhat dot com> <20150502130359 dot GY3618 at redhat dot com> <CAGNvRgD=bfouktexLpx2UXazV7Fe0X3A9A49QXXH5fU-oxJ5vw at mail dot gmail dot com> <20150502173303 dot GD3618 at redhat dot com>
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