]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* decl.c (cp_finish_decl): Mostly revert previous change.
authorJason Merrill <jason@redhat.com>
Sat, 5 Nov 2011 21:06:34 +0000 (17:06 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 5 Nov 2011 21:06:34 +0000 (17:06 -0400)
From-SVN: r181017

gcc/cp/ChangeLog
gcc/cp/decl.c

index 200621e3f9f9f4b3d41fc6163f09a49f8d0c31e6..642c507b350f10a53cdc89984ffb0b789ef0c35d 100644 (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
index 65413df26203b03283c7f209007b54704302eb7d..d2daf9189566c70cdcc47e0de40df0497ab15e6b 100644 (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;