summaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2018-05-20 23:18:29 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2018-05-20 23:19:35 -0400
commit184cde7552b5434196b8380be23b39ff4a5a17e6 (patch)
tree81ae1abf58389b739753cd699e39695d4400848c /gdb/common
parente39db4db7c553ae1c4aaf158cd0ebf3cf6d478fb (diff)
downloadbinutils-gdb-184cde7552b5434196b8380be23b39ff4a5a17e6.tar.gz
Fix copy-pasto, allocate objfile_per_bfd_storage with obstack_new
I realized after pushing that I made a copy-pasto, I had: # define HAVE_IS_TRIVIALLY_COPYABLE 1 instead of # define HAVE_IS_TRIVIALLY_CONSTRUCTIBLE 1 with the consequence that IsMallocable was always std::true_type (and was therefore not enforcing anything). Fixing that mistake triggered a build failure: /home/simark/src/binutils-gdb/gdb/objfiles.c:150:12: required from here /home/simark/src/binutils-gdb/gdb/common/poison.h:228:3: error: static assertion failed: Trying to use XOBNEW with a non-POD data type. I am not sure why I did not see this when I originally wrote the patch (but I saw and fixed other failures). In any case, I swapped XOBNEW with obstack_new to get rid of it. Regtested on the buildbot. gdb/ChangeLog: * common/traits.h (HAVE_IS_TRIVIALLY_COPYABLE): Rename the wrong instance to... (HAVE_IS_TRIVIALLY_CONSTRUCTIBLE): ... this. * objfiles.c (get_objfile_bfd_data): Allocate objfile_per_bfd_storage with obstack_new when allocating on obstack.
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/traits.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/common/traits.h b/gdb/common/traits.h
index 070ef159e5b..e1066e0d97e 100644
--- a/gdb/common/traits.h
+++ b/gdb/common/traits.h
@@ -38,7 +38,7 @@
in GCC 5. */
#if (__has_feature(is_trivially_constructible) \
|| (defined __GNUC__ && __GNUC__ >= 5))
-# define HAVE_IS_TRIVIALLY_COPYABLE 1
+# define HAVE_IS_TRIVIALLY_CONSTRUCTIBLE 1
#endif
namespace gdb {