aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-02-21 11:46:52 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2024-02-21 13:30:19 -0500
commit23acbfee6a82cc147b04b74a89d5b34b47c150f4 (patch)
treee9c528c8ed51b58eb3b51d3427346f664c7cf674 /gdb/unittests
parentaca8a74923c4a0c222a2f8f5f3e23de84ab19e77 (diff)
downloadbinutils-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 'gdb/unittests')
-rw-r--r--gdb/unittests/array-view-selftests.c4
-rw-r--r--gdb/unittests/enum-flags-selftests.c4
-rw-r--r--gdb/unittests/packed-selftests.c4
3 files changed, 0 insertions, 12 deletions
diff --git a/gdb/unittests/array-view-selftests.c b/gdb/unittests/array-view-selftests.c
index 9d2448f..299318a 100644
--- a/gdb/unittests/array-view-selftests.c
+++ b/gdb/unittests/array-view-selftests.c
@@ -30,15 +30,11 @@ namespace array_view_tests {
#define CHECK_TRAIT(TRAIT) \
static_assert (std::TRAIT<gdb::array_view<gdb_byte>>::value, "")
-#if HAVE_IS_TRIVIALLY_COPYABLE
-
CHECK_TRAIT (is_trivially_copyable);
CHECK_TRAIT (is_trivially_move_assignable);
CHECK_TRAIT (is_trivially_move_constructible);
CHECK_TRAIT (is_trivially_destructible);
-#endif
-
#undef CHECK_TRAIT
/* Wrapper around std::is_convertible to make the code using it a bit
diff --git a/gdb/unittests/enum-flags-selftests.c b/gdb/unittests/enum-flags-selftests.c
index 607b8ac..54e1681 100644
--- a/gdb/unittests/enum-flags-selftests.c
+++ b/gdb/unittests/enum-flags-selftests.c
@@ -63,14 +63,10 @@ DEF_ENUM_FLAGS_TYPE (RE, EF);
DEF_ENUM_FLAGS_TYPE (RE2, EF2);
DEF_ENUM_FLAGS_TYPE (URE, UEF);
-#if HAVE_IS_TRIVIALLY_COPYABLE
-
/* So that std::vectors of types that have enum_flags fields can
reallocate efficiently memcpy. */
static_assert (std::is_trivially_copyable<EF>::value);
-#endif
-
/* A couple globals used as lvalues in the CHECK_VALID expressions
below. Their names (and types) match the uppercase type names
exposed by CHECK_VALID just to make the expressions easier to
diff --git a/gdb/unittests/packed-selftests.c b/gdb/unittests/packed-selftests.c
index 3f20861..852a7d3 100644
--- a/gdb/unittests/packed-selftests.c
+++ b/gdb/unittests/packed-selftests.c
@@ -46,16 +46,12 @@ static_assert (alignof (packed<test_enum, 4>) == 1);
#define CHECK_TRAIT(TRAIT) \
static_assert (std::TRAIT<packed<test_enum, 1>>::value, "")
-#if HAVE_IS_TRIVIALLY_COPYABLE
-
CHECK_TRAIT (is_trivially_copyable);
CHECK_TRAIT (is_trivially_copy_constructible);
CHECK_TRAIT (is_trivially_move_constructible);
CHECK_TRAIT (is_trivially_copy_assignable);
CHECK_TRAIT (is_trivially_move_assignable);
-#endif
-
#undef CHECK_TRAIT
/* Entry point. */