From: Roland McGrath Date: Sat, 4 Jul 2009 08:17:24 +0000 (-0700) Subject: Avoid default copy-constructor for dwarf_edit from dwarf_edit. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=268d026be814f02595bc531e13d05e33cb828189;p=thirdparty%2Felfutils.git Avoid default copy-constructor for dwarf_edit from dwarf_edit. --- 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 {