aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-02-26 10:19:07 -0700
committerTom Tromey <tromey@adacore.com>2024-03-21 12:21:24 -0600
commit7f032bbedf3e66f6695d4df0d149c2e8033224da (patch)
tree3e29a70d55d9e9952f81d6f91411e2cee13ac028 /gdb/block.c
parent9069d69398649cd9a54e4dcac8548b10ece8a304 (diff)
downloadgdb-7f032bbedf3e66f6695d4df0d149c2e8033224da.zip
gdb-7f032bbedf3e66f6695d4df0d149c2e8033224da.tar.gz
gdb-7f032bbedf3e66f6695d4df0d149c2e8033224da.tar.bz2
Require trivial destructor in allocate_on_obstack
This patch makes allocate_on_obstack a little bit safer, by enforcing the rule that objects allocated on an obstack must have a trivial destructor. The static assert is done in a method -- doing it inside the class itself won't work because the class is incomplete at that point.
Diffstat (limited to 'gdb/block.c')
-rw-r--r--gdb/block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/block.c b/gdb/block.c
index 079053c..6d0d33f 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -31,7 +31,7 @@
C++ files, namely using declarations and the current namespace in
scope. */
-struct block_namespace_info : public allocate_on_obstack
+struct block_namespace_info : public allocate_on_obstack<block_namespace_info>
{
const char *scope = nullptr;
struct using_direct *using_decl = nullptr;