This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/5] Poison non-POD memset & non-trivially-copyable memcpy/memmove
On 04/25/2017 09:24 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
> Hi Pedro,
>
>> +/* True if "T *" is relocatable. I.e., copyable with memcpy/memmove.
>> + I.e., T is either trivially copyable, or void. */
>> +template<typename T>
>> +struct IsRelocatable
>> + : gdb::Or<std::is_void<T>,
>> + std::is_trivially_copyable<T>>
>> +{};
>
> This breaks the build with gcc 4.8,
>
> In file included from ../../binutils-gdb/gdb/common/common-defs.h:85:0,
> from ../../binutils-gdb/gdb/defs.h:28,
> from ../../binutils-gdb/gdb/gdb.c:19:
> ../../binutils-gdb/gdb/common/poison.h:66:6: error: ‘is_trivially_copyable’ is not a member of ‘std’
> std::is_trivially_copyable<T>>
> ^
>
Sorry, I thought I had tested gcc 4.8, but clearly I did not. I'll fix it
as soon as I have a chance, probably by disabling the poisoning on
older compilers.
> you probably have already received the buildbot fail message
> https://gdb-build.sergiodj.net/builders/Ubuntu-AArch64-m64/builds/1845
>
> is_trivially_copyable is missing on 4.9 too,
> https://gcc.gnu.org/onlinedocs/gcc-4.9.4/libstdc++/manual/manual/status.html#status.iso.2011
> and it was added in gcc 5, as far as I know.
Thanks,
Pedro Alves