+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/48370
+ * decl.c (cp_finish_decl): Run cleanups in the right order.
+
2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
PR c++/50608
tree asmspec_tree, int flags)
{
tree type;
- VEC(tree,gc) *cleanups = NULL;
+ VEC(tree,gc) *cleanups = make_tree_vector ();
+ unsigned i; tree t;
const char *asmspec = NULL;
int was_readonly = 0;
bool var_definition_p = false;
/* If a CLEANUP_STMT was created to destroy a temporary bound to a
reference, insert it in the statement-tree now. */
- if (cleanups)
- {
- unsigned i; tree t;
- FOR_EACH_VEC_ELT_REVERSE (tree, cleanups, i, t)
- push_cleanup (decl, t, false);
- }
+ FOR_EACH_VEC_ELT (tree, cleanups, i, t)
+ push_cleanup (decl, t, false);
+ release_tree_vector (cleanups);
if (was_readonly)
TREE_READONLY (decl) = 1;
+2011-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/48370
+ * g++.dg/init/lifetime1.C: Test cleanup order.
+
2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/other/offsetof7.C: New test.