OSDN Git Service

* name-lookup.c (leave_scope): We only need to update
[pf3gnuchains/gcc-fork.git] / gcc / cp / optimize.c
index b94270e..7ccfaff 100644 (file)
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "varray.h"
 #include "params.h"
 #include "hashtab.h"
+#include "target.h"
 #include "debug.h"
 #include "tree-inline.h"
 #include "flags.h"
@@ -184,6 +185,13 @@ maybe_clone_body (tree fn)
            }
        }
 
+      if (targetm.cxx.cdtor_returns_this ())
+       {
+         parm = DECL_RESULT (fn);
+         clone_parm = DECL_RESULT (clone);
+         splay_tree_insert (decl_map, (splay_tree_key) parm,
+                            (splay_tree_value) clone_parm);
+       }
       /* Clone the body.  */
       clone_body (clone, fn, decl_map);