diff options
author | mmitchell <mmitchell@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-16 10:54:48 +0000 |
---|---|---|
committer | mmitchell <mmitchell@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-16 10:54:48 +0000 |
commit | ec839ca8bc7448d679e5766a5416c5d74adf7e0a (patch) | |
tree | 74de6c9704cb3b3b0d5fe66337b06c66770850bf /gcc | |
parent | e6b2f841fa2af384af05a347b44062ba1afa03e4 (diff) | |
download | gcc-ec839ca8bc7448d679e5766a5416c5d74adf7e0a.tar.gz |
* pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
closely mimics the behavior in parse.y.
(tsubst_expr): Return the resuting BLOCK when making a tsubst'ing
into a compound statement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9b47256da9c..90e2a2b6b7b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +Mon Mar 16 10:54:21 1998 Mark Mitchell <mmitchell@usa.net> + + * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more + closely mimics the behavior in parse.y. + (tsubst_expr): Return the resuting BLOCK when making a tsubst'ing + into a compound statement. + Sun Mar 15 02:07:26 1998 Jason Merrill <jason@yorick.cygnus.com> * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 52a42545763..f261edfa1e4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4553,11 +4553,12 @@ tsubst_copy (t, args, in_decl) build_expr_from_tree. So, we need to expand the BIND_EXPR here. */ tree rtl_exp = expand_start_stmt_expr(); - tsubst_expr (TREE_OPERAND (r, 1), args, in_decl); + tree block = tsubst_expr (TREE_OPERAND (r, 1), args, in_decl); rtl_exp = expand_end_stmt_expr (rtl_exp); TREE_SIDE_EFFECTS (rtl_exp) = 1; - return build (BIND_EXPR, TREE_TYPE (rtl_exp), - NULL_TREE, rtl_exp, TREE_OPERAND (r, 2)); + r = build (BIND_EXPR, TREE_TYPE (rtl_exp), + NULL_TREE, rtl_exp, block); + delete_block (block); } return r; @@ -4841,7 +4842,7 @@ tsubst_expr (t, args, in_decl) tsubst_expr (substmt, args, in_decl); if (COMPOUND_STMT_NO_SCOPE (t) == 0) - do_poplevel (); + return do_poplevel (); } break; |