(finish_constructor_body): Add it, to mark the end of the
constructor.
(finish_function): Don't call end_protect_partials here.
* ir.texi (CTOR_COMPLETE): Document it.
* semantics.c (expand_stmt): Handle it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30630
138bc75d-0d04-0410-961f-
82ee72b054a4
1999-11-22 Mark Mitchell <mark@codesourcery.com>
+ * cp-tree.def (CTOR_COMPLETE): New tree node.
+ (finish_constructor_body): Add it, to mark the end of the
+ constructor.
+ (finish_function): Don't call end_protect_partials here.
+ * ir.texi (CTOR_COMPLETE): Document it.
+ * semantics.c (expand_stmt): Handle it.
+
* cp-tree.def (FUNCTION_NAME): New tree node.
* cp-tree.h (current_function_name_declared): Tweak documentation.
(lang_decl_flags): Add pretty_function_p, adjust dummy.
run if an exception is thrown before the end of the enclosing
function. */
DEFTREECODE (SUBOBJECT, "subobject", 'e', 1)
+/* A CTOR_COMPLETE statements marks the end of the main body of the
+ constructor, not including any function try blocks. */
+DEFTREECODE (CTOR_COMPLETE, "ctor_complete", 'e', 0)
/* A CLEANUP_STMT marks the point at which a declaration is fully
constructed. If, after this point, the CLEANUP_DECL goes out of
scope, the CLEANUP_EXPR must be run. */
Used to represent a @code{continue} statement. There are no additional
fields.
+@item CTOR_COMPLETE
+
+Used to mark the end of the main body of a constructor.
+
@item DECL_STMT
Used to represent a local declaration. The @code{DECL_STMT_DECL} macro
In a constructor, these nodes are used to mark the point at which a
subobject of @code{this} is fully constructed. If, after this point, an
-exception is thrown before the constructor finishes executing, the
+exception is thrown before a CTOR_COMPLETE statement is encountered, the
@code{SUBOBJECT_CLEANUP} must be executed. The cleanups must be
executed in the reverse order in which they appear.
finish_expr_stmt (EXPR_STMT_EXPR (t));
break;
+ case CTOR_COMPLETE:
+ /* All subobjects have been fully constructed at this point. */
+ end_protect_partials ();
+ break;
+
case DECL_STMT:
{
tree decl;
// make sure we don't call base dtors, if we failed to call the
// base ctor due to exception throwing
-// execution test - XFAIL *-*-*
-
#include <stdio.h>
static bool bad = false;