diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-02-21 11:46:52 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-02-21 13:30:19 -0500 |
commit | 23acbfee6a82cc147b04b74a89d5b34b47c150f4 (patch) | |
tree | e9c528c8ed51b58eb3b51d3427346f664c7cf674 /gdbsupport/poison.h | |
parent | aca8a74923c4a0c222a2f8f5f3e23de84ab19e77 (diff) | |
download | binutils-23acbfee6a82cc147b04b74a89d5b34b47c150f4.zip binutils-23acbfee6a82cc147b04b74a89d5b34b47c150f4.tar.gz binutils-23acbfee6a82cc147b04b74a89d5b34b47c150f4.tar.bz2 |
gdbsupport: assume that compiler supports std::{is_trivially_constructible,is_trivially_copyable}
This code was there to support g++ 4, which didn't support
std::is_trivially_constructible and std::is_trivially_copyable. Since
we now require g++ >= 9, I think it's fair to assume that GDB will
always be compiled with a compiler that supports those.
Change-Id: Ie7c1649139a2f48bf662cac92d7f3e38fb1f1ba1
Diffstat (limited to 'gdbsupport/poison.h')
-rw-r--r-- | gdbsupport/poison.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/gdbsupport/poison.h b/gdbsupport/poison.h index 0d0159e..7b4f8e8 100644 --- a/gdbsupport/poison.h +++ b/gdbsupport/poison.h @@ -56,8 +56,6 @@ template <typename T, typename = gdb::Requires<gdb::Not<IsMemsettable<T>>>> void *memset (T *s, int c, size_t n) = delete; -#if HAVE_IS_TRIVIALLY_COPYABLE - /* Similarly, poison memcpy and memmove of non trivially-copyable types, which is undefined. */ @@ -83,17 +81,11 @@ template <typename D, typename S, typename = gdb::Requires<gdb::Not<BothAreRelocatable<D, S>>>> void *memmove (D *dest, const S *src, size_t n) = delete; -#endif /* HAVE_IS_TRIVIALLY_COPYABLE */ - /* Poison XNEW and friends to catch usages of malloc-style allocations on objects that require new/delete. */ template<typename T> -#if HAVE_IS_TRIVIALLY_CONSTRUCTIBLE using IsMallocable = std::is_trivially_constructible<T>; -#else -using IsMallocable = std::true_type; -#endif template<typename T> using IsFreeable = gdb::Or<std::is_trivially_destructible<T>, std::is_void<T>>; |