aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-11-05 17:06:34 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-11-05 17:06:34 -0400
commit90dba8f44e23fc8a9c4723122dd2ab781567f76c (patch)
treede7f10c872fcc1609d439eb029ce2014c53656bb /gcc
parentfeeeff5cfe8c282a769346285fee4f7b6deac64d (diff)
downloadgcc-90dba8f44e23fc8a9c4723122dd2ab781567f76c.zip
gcc-90dba8f44e23fc8a9c4723122dd2ab781567f76c.tar.gz
gcc-90dba8f44e23fc8a9c4723122dd2ab781567f76c.tar.bz2
* decl.c (cp_finish_decl): Mostly revert previous change.
From-SVN: r181017
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 200621e..642c507 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 65413df..d2daf91 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;