PR c++/40975
* tree-inline.c (copy_tree_r): Handle STATEMENT_LIST.
From-SVN: r173454
+2011-05-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/40975
+ * tree-inline.c (copy_tree_r): Handle STATEMENT_LIST.
+
2011-05-05 Julian Brown <julian@codesourcery.com>
* config/arm/neon.md (vec_set<mode>_internal): Fix misplaced
+2011-05-05 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/init/new30.C: New.
+
2011-05-05 Julian Brown <julian@codesourcery.com>
* gcc.target/arm/neon-vset_lanes8.c: New test.
--- /dev/null
+// PR c++/40975
+
+struct data_type
+{
+ // constructor required to reproduce compiler bug
+ data_type() {}
+};
+
+struct ptr_type
+{
+ // array new as default argument required to reproduce compiler bug
+ ptr_type (data_type* ptr = new data_type[1]) { delete[] ptr; }
+};
+
+ptr_type obj;
CONSTRUCTOR_ELTS (*tp));
*tp = new_tree;
}
+ else if (code == STATEMENT_LIST)
+ /* We used to just abort on STATEMENT_LIST, but we can run into them
+ with statement-expressions (c++/40975). */
+ copy_statement_list (tp);
else if (TREE_CODE_CLASS (code) == tcc_type)
*walk_subtrees = 0;
else if (TREE_CODE_CLASS (code) == tcc_declaration)
*walk_subtrees = 0;
else if (TREE_CODE_CLASS (code) == tcc_constant)
*walk_subtrees = 0;
- else
- gcc_assert (code != STATEMENT_LIST);
return NULL_TREE;
}