From 588e7a57056e8aabdd6906993dd3d27354cc70fc Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 4 Jan 2021 21:40:41 +0100 Subject: [PATCH] Fix building gdb with gcc-4.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since is_trivially_default_constructible was not implemented before gcc-5 it cannot be used with gcc-4.x. ../../binutils-gdb/gdb/trad-frame.c: In function ‘trad_frame_saved_reg* trad_frame_alloc_saved_regs(gdbarch*)’: ../../binutils-gdb/gdb/trad-frame.c:64:22: error: ‘is_trivially_default_constructible’ is not a member of ‘std’ gdb_static_assert (std::is_trivially_default_constructible::value); Fix the build by using conditional compilation around that line. Use the equivalent is_trivially_constructible instead, since we already have HAVE_IS_TRIVIALLY_CONSTRUCTIBLE for that purpose. Fixes: 098caef485a ("Refactor struct trad_frame_saved_regs") gdb: 2021-01-14 Bernd Edlinger * trad-frame.c (trad_frame_alloc_saved_regs): Avoid compile-error because is_trivially_default_constructible was first implemented with gcc-5. --- gdb/trad-frame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c index 17375e8..3284c45 100644 --- a/gdb/trad-frame.c +++ b/gdb/trad-frame.c @@ -25,6 +25,7 @@ #include "target.h" #include "value.h" #include "gdbarch.h" +#include "gdbsupport/traits.h" struct trad_frame_cache { @@ -60,7 +61,9 @@ struct trad_frame_cache * trad_frame_saved_reg * trad_frame_alloc_saved_regs (struct gdbarch *gdbarch) { - gdb_static_assert (std::is_trivially_default_constructible::value); +#ifdef HAVE_IS_TRIVIALLY_CONSTRUCTIBLE + gdb_static_assert (std::is_trivially_constructible::value); +#endif int numregs = gdbarch_num_cooked_regs (gdbarch); trad_frame_saved_reg *this_saved_regs -- 1.9.1