------- Comment #10 from janus at gcc dot gnu dot org 2010-01-28 14:51 ------- (In reply to comment #9) > Index: gcc/fortran/trans-stmt.c > =================================================================== > --- gcc/fortran/trans-stmt.c (revision 156258) > +++ gcc/fortran/trans-stmt.c (working copy) > @@ -4180,6 +4180,7 @@ gfc_trans_allocate (gfc_code * code) > else if (expr->ts.type == BT_DERIVED > && (init_e = gfc_default_initializer (&expr->ts))) > { > + gfc_resolve_expr (init_e); > tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr), > init_e, true); > gfc_add_expr_to_block (&block, tmp);
This patch does not induce any regressions in the testsuite. However, the question is if there are other problems, e.g. when resolve_structure_cons would throw an error message. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42888