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

Jonathan Wakely jwakely@redhat.com
Sat May 2 18:20:00 GMT 2015


On 02/05/15 19:51 +0200, Daniel Krügler wrote:
>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.

Fixed like so, tested powerpc64le-linux and powerpc-aix, committed to
trunk. I'll do something similar on the gcc5 branch too, but not
today.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3645 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150502/e5c1a57a/attachment.bin>


More information about the Gcc-patches mailing list