* decl.c (cp_finish_decl): Mostly revert previous change.

From-SVN: r181017
This commit is contained in:
Jason Merrill 2011-11-05 17:06:34 -04:00 committed by Jason Merrill
parent feeeff5cfe
commit 90dba8f44e
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2011-11-05 Jason Merrill <jason@redhat.com>
* decl.c (cp_finish_decl): Mostly revert previous change.
2011-11-04 Jason Merrill <jason@redhat.com>
PR c++/26714

View File

@ -5907,8 +5907,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
tree asmspec_tree, int flags)
{
tree type;
VEC(tree,gc) *cleanups = make_tree_vector ();
unsigned i; tree t;
VEC(tree,gc) *cleanups = NULL;
const char *asmspec = NULL;
int was_readonly = 0;
bool var_definition_p = false;
@ -6316,9 +6315,12 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
/* If a CLEANUP_STMT was created to destroy a temporary bound to a
reference, insert it in the statement-tree now. */
FOR_EACH_VEC_ELT (tree, cleanups, i, t)
push_cleanup (decl, t, false);
release_tree_vector (cleanups);
if (cleanups)
{
unsigned i; tree t;
FOR_EACH_VEC_ELT (tree, cleanups, i, t)
push_cleanup (decl, t, false);
}
if (was_readonly)
TREE_READONLY (decl) = 1;