------- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-11-21 13:53 ------- It's fixed by the simple patch below:
Index: resolve.c =================================================================== --- resolve.c (revision 130234) +++ resolve.c (working copy) @@ -740,6 +740,8 @@ resolve_structure_cons (gfc_expr *expr) for (; comp; comp = comp->next, cons = cons->next) { + int rank; + if (!cons->expr) continue; @@ -749,14 +751,14 @@ resolve_structure_cons (gfc_expr *expr) continue; } - if (cons->expr->expr_type != EXPR_NULL - && comp->as && comp->as->rank != cons->expr->rank + rank = comp->as ? comp->as->rank : 0; + if (cons->expr->expr_type != EXPR_NULL && rank != cons->expr->rank && (comp->allocatable || cons->expr->rank)) { gfc_error ("The rank of the element in the derived type " "constructor at %L does not match that of the " "component (%d/%d)", &cons->expr->where, - cons->expr->rank, comp->as ? comp->as->rank : 0); + cons->expr->rank, rank); t = FAILURE; } I'll regtest and submit later this week. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-11-13 15:44:50 |2007-11-21 13:53:53 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34083