+2002-10-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8287
+ * decl.c (finish_destructor_body): Create the label to jump to
+ when returning from a destructor here.
+ (finish_function_body): Rather than here.
+
2002-10-25 Zack Weinberg <zack@codesourcery.com>
PR c++/7266
{
tree exprstmt;
+ /* Any return from a destructor will end up here; that way all base
+ and member cleanups will be run when the function returns. */
+ add_stmt (build_stmt (LABEL_STMT, dtor_label));
+
/* In a virtual destructor, we must call delete. */
if (DECL_VIRTUAL_P (current_function_decl))
{
finish_function_body (compstmt)
tree compstmt;
{
- if (processing_template_decl)
- /* Do nothing now. */;
- else if (DECL_DESTRUCTOR_P (current_function_decl))
- /* Any return from a destructor will end up here. Put it before the
- cleanups so that an explicit return doesn't duplicate them. */
- add_stmt (build_stmt (LABEL_STMT, dtor_label));
-
- /* Close the block; in a destructor, run the member cleanups. */
+ /* Close the block. */
finish_compound_stmt (0, compstmt);
if (processing_template_decl)