summaryrefslogtreecommitdiff
path: root/gcc/cp/except.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-09 10:45:00 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-09 10:45:00 +0000
commit2c440a1334f71402905241113ec103d0e92d165e (patch)
treea2b2205f5538c97f3d3612a644b1c184a46ccb8f /gcc/cp/except.c
parent7fea7f4a7d3fef7a98ddc65dac7ccb00c8ec6754 (diff)
downloadgcc-2c440a1334f71402905241113ec103d0e92d165e.tar.gz
* semantics.c (begin_function_try_block, finish_function_try_block,
finish_function_handler_sequence): New fns. * parse.y (function_try_block): Use them. * pt.c (instantiate_decl): Likewise. * cp-tree.h: Declare in_function_try_handler. * decl.c: Define it. (start_function): Clear it. (struct cp_function, push_cp_function_context): Save it. (pop_cp_function_context): Restore it. * parse.y (function_try_block): Set and clear it. * except.c (expand_end_catch_block): Rethrow if we reach the end of a function-try-block handler in a ctor or dtor. * typeck.c (c_expand_return): Complain about returning from a function-try-block handler of a ctor. * parse.y (function_try_block): Call end_protect_partials before expand_start_all_catch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28624 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r--gcc/cp/except.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index e5afb897177..dd708556e63 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -698,6 +698,13 @@ expand_end_catch_block ()
if (! doing_eh (1))
return;
+ /* The exception being handled is rethrown if control reaches the end of
+ a handler of the function-try-block of a constructor or destructor. */
+ if (in_function_try_handler
+ && (DECL_CONSTRUCTOR_P (current_function_decl)
+ || DECL_DESTRUCTOR_P (current_function_decl)))
+ expand_throw (NULL_TREE);
+
/* Cleanup the EH parameter. */
expand_end_bindings (getdecls (), kept_level_p (), 0);
poplevel (kept_level_p (), 1, 0);