From f92ff6b55219a7c4c54a62412e194bbda713cf46 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 11 Feb 2020 17:31:10 -0700 Subject: Don't allow copying of auto_obstack 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 * gdb_obstack.h (struct auto_obstack): Use DISABLE_COPY_AND_ASSIGN. Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd --- gdb/gdb_obstack.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb/gdb_obstack.h') diff --git a/gdb/gdb_obstack.h b/gdb/gdb_obstack.h index fb9295f5020..9b1d907678f 100644 --- a/gdb/gdb_obstack.h +++ b/gdb/gdb_obstack.h @@ -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 () -- cgit v1.2.1