aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-11-23 07:31:07 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-11-23 07:31:07 +0000
commit083eb5756fe3cb25a697d9d2d8b65fdaa0646878 (patch)
tree2994dcb7eddba39d83f51e1425155623f1f1fe9a
parent4e32293ce6e25dfe4f3f756032a044f4d39e70d1 (diff)
downloadgcc-083eb5756fe3cb25a697d9d2d8b65fdaa0646878.zip
gcc-083eb5756fe3cb25a697d9d2d8b65fdaa0646878.tar.gz
gcc-083eb5756fe3cb25a697d9d2d8b65fdaa0646878.tar.bz2
cp-tree.def (CTOR_COMPLETE): New tree node.
* 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. From-SVN: r30630
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-tree.def3
-rw-r--r--gcc/cp/ir.texi6
-rw-r--r--gcc/cp/semantics.c5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/cleanup2.C2
5 files changed, 20 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d214aaa..b5fdd4c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,12 @@
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.
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index de874cb..59b14fd 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -237,6 +237,9 @@ DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 5)
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. */
diff --git a/gcc/cp/ir.texi b/gcc/cp/ir.texi
index b31fd1d..09ae98d 100644
--- a/gcc/cp/ir.texi
+++ b/gcc/cp/ir.texi
@@ -1274,6 +1274,10 @@ following the @code{TREE_CHAIN} link from one substatement to the next.
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
@@ -1383,7 +1387,7 @@ equalit) to @code{CATCH_ALL_TYPE} if this handler is for all types.
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.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 37510e5..7a030e6 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2268,6 +2268,11 @@ expand_stmt (t)
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;
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/cleanup2.C b/gcc/testsuite/g++.old-deja/g++.eh/cleanup2.C
index 08b3c5d..b9ed9a5 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/cleanup2.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/cleanup2.C
@@ -4,8 +4,6 @@
// 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;