From 268d026be814f02595bc531e13d05e33cb828189 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 4 Jul 2009 01:17:24 -0700 Subject: [PATCH] Avoid default copy-constructor for dwarf_edit from dwarf_edit. --- libdw/c++/dwarf_edit | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libdw/c++/dwarf_edit b/libdw/c++/dwarf_edit index 92645a366..da7306233 100644 --- a/libdw/c++/dwarf_edit +++ b/libdw/c++/dwarf_edit @@ -352,6 +352,8 @@ namespace elfutils private: compile_units _m_units; + typedef dwarf_ref_maker edit_ref_maker; + public: class compile_units &compile_units () { @@ -368,7 +370,6 @@ namespace elfutils return compile_units ().add_unit (); } - public: // Default constructor: an empty container, no CUs. inline dwarf_edit () : _m_units () @@ -395,6 +396,16 @@ namespace elfutils guard.clear (); } + // We have to write this explicitly or it will do default-copying! + inline dwarf_edit (const dwarf_edit &dw, + edit_ref_maker t = edit_ref_maker (), + subr::guard guard + = subr::guard ()) + : _m_units (dw.compile_units (), guard (t)) + { + guard.clear (); + } + template inline bool operator== (const file &other) const { -- 2.47.3