aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-07-12 13:36:57 +0200
committerTom de Vries <tdevries@suse.de>2022-07-12 13:36:57 +0200
commit02f0597c46892c4b69e0af45a95509bf310c759e (patch)
treeba7369902b9d317ab5cc4ec1d43f898477e33a36
parentac3972d81f1065a156daa0da97320262845c2469 (diff)
downloadgdb-02f0597c46892c4b69e0af45a95509bf310c759e.zip
gdb-02f0597c46892c4b69e0af45a95509bf310c759e.tar.gz
gdb-02f0597c46892c4b69e0af45a95509bf310c759e.tar.bz2
[gdb/build] Fix build with gcc 4.8.5
When building gdb with gcc 4.8.5, we run into problems due to unconditionally using: ... gdb_static_assert (std::is_trivially_copyable<packed>::value); ... in gdbsupport/packed.h. Fix this by guarding the usage with HAVE_IS_TRIVIALLY_COPYABLE. Tested by doing a full gdb build with gcc 4.8.5.
-rw-r--r--gdbsupport/packed.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdbsupport/packed.h b/gdbsupport/packed.h
index ebc66c0..cd331b5 100644
--- a/gdbsupport/packed.h
+++ b/gdbsupport/packed.h
@@ -18,6 +18,8 @@
#ifndef PACKED_H
#define PACKED_H
+#include "traits.h"
+
/* Each instantiation and full specialization of the packed template
defines a type that behaves like a given scalar type, but that has
byte alignment, and, may optionally have a smaller size than the
@@ -38,7 +40,9 @@ public:
gdb_static_assert (alignof (packed) == 1);
/* Make sure packed can be wrapped with std::atomic. */
+#if HAVE_IS_TRIVIALLY_COPYABLE
gdb_static_assert (std::is_trivially_copyable<packed>::value);
+#endif
gdb_static_assert (std::is_copy_constructible<packed>::value);
gdb_static_assert (std::is_move_constructible<packed>::value);
gdb_static_assert (std::is_copy_assignable<packed>::value);