Don't allow copying of auto_obstack
authorTom Tromey <tom@tromey.com>
Wed, 12 Feb 2020 00:31:10 +0000 (17:31 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 12 Feb 2020 00:57:46 +0000 (17:57 -0700)
Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying
it.  Copying an auto_obstack would be a bug.

2020-02-11  Tom Tromey  <tom@tromey.com>

* gdb_obstack.h (struct auto_obstack): Use
DISABLE_COPY_AND_ASSIGN.

Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd

gdb/ChangeLog
gdb/gdb_obstack.h

index 72a6292101baf12da664d208359b51f1d79d16c5..4a4fa054c8975ed5833a159387bcef2ef59555f4 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-11  Tom Tromey  <tom@tromey.com>
+
+       * gdb_obstack.h (struct auto_obstack): Use
+       DISABLE_COPY_AND_ASSIGN.
+
 2020-02-11  Tom Tromey  <tom@tromey.com>
 
        * dwarf2/frame.h (struct objfile): Don't forward declare.
index fb9295f5020a27c7c1364d526acb98a0b8c16b41..9b1d907678f58109ae44bab3786722c1bec3bb62 100644 (file)
@@ -125,6 +125,8 @@ struct auto_obstack : obstack
   ~auto_obstack ()
   { obstack_free (this, NULL); }
 
+  DISABLE_COPY_AND_ASSIGN (auto_obstack);
+
   /* Free all memory in the obstack but leave it valid for further
      allocation.  */
   void clear ()