+2013-04-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/34949
+ * decl.c (begin_destructor_body): Clobber the object in a cleanup.
+
2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
* friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
initialize_vtbl_ptrs (current_class_ptr);
finish_compound_stmt (compound_stmt);
+ /* Insert a cleanup to let the back end know that the object is dead
+ when we exit the destructor, either normally or via exception. */
+ tree clobber = build_constructor (current_class_type, NULL);
+ TREE_THIS_VOLATILE (clobber) = true;
+ tree exprstmt = build2 (MODIFY_EXPR, current_class_type,
+ current_class_ref, clobber);
+ finish_decl_cleanup (NULL_TREE, exprstmt);
+
/* And insert cleanups for our bases and members so that they
will be properly destroyed if we throw. */
push_base_cleanups ();