From 0879e2cff0ea732769aa80b89fa6fbba70c84260 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 build by using conditional compilation around that line. Fixes: 098caef485a ("Refactor struct trad_frame_saved_regs") gdb: 2021-01-04 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c index 17375e8..de1acc1 100644 --- a/gdb/trad-frame.c +++ b/gdb/trad-frame.c @@ -60,7 +60,9 @@ struct trad_frame_cache * trad_frame_saved_reg * trad_frame_alloc_saved_regs (struct gdbarch *gdbarch) { +#if defined(__GNUC__) && __GNUC__ >= 5 gdb_static_assert (std::is_trivially_default_constructible::value); +#endif int numregs = gdbarch_num_cooked_regs (gdbarch); trad_frame_saved_reg *this_saved_regs -- 1.9.1