]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Avoid default copy-constructor for dwarf_edit from dwarf_edit.
authorRoland McGrath <roland@redhat.com>
Sat, 4 Jul 2009 08:17:24 +0000 (01:17 -0700)
committerRoland McGrath <roland@redhat.com>
Sat, 4 Jul 2009 08:17:24 +0000 (01:17 -0700)
libdw/c++/dwarf_edit

index 92645a36657f3d1062252e78fa43db4f1c7e2e74..da730623337b0c1f0e4cf0c61994f2cfb95631bf 100644 (file)
@@ -352,6 +352,8 @@ namespace elfutils
   private:
     compile_units _m_units;
 
+    typedef dwarf_ref_maker<dwarf_edit, dwarf_edit> 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<edit_ref_maker > guard
+                      = subr::guard<edit_ref_maker > ())
+      : _m_units (dw.compile_units (), guard (t))
+    {
+      guard.clear ();
+    }
+
     template<typename file>
     inline bool operator== (const file &other) const
     {