http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org --- Comment #2 from janus at gcc dot gnu.org --- This patch fixes the error: Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 207846) +++ gcc/fortran/resolve.c (working copy) @@ -1134,8 +1134,6 @@ resolve_structure_cons (gfc_expr *expr, int init) for (; comp && cons; comp = comp->next, cons = gfc_constructor_next (cons)) { - int rank; - if (!cons->expr) continue; @@ -1145,15 +1143,18 @@ resolve_structure_cons (gfc_expr *expr, int init) continue; } - rank = comp->as ? comp->as->rank : 0; - if (cons->expr->expr_type != EXPR_NULL && rank != cons->expr->rank - && (comp->attr.allocatable || cons->expr->rank)) + if (!comp->attr.proc_pointer) { - gfc_error ("The rank of the element in the structure " - "constructor at %L does not match that of the " - "component (%d/%d)", &cons->expr->where, - cons->expr->rank, rank); - t = false; + int rank = comp->as ? comp->as->rank : 0; + if (cons->expr->expr_type != EXPR_NULL && rank != cons->expr->rank + && (comp->attr.allocatable || cons->expr->rank)) + { + gfc_error ("The rank of the element in the structure " + "constructor at %L does not match that of the " + "component (%d/%d)", &cons->expr->where, + cons->expr->rank, rank); + t = false; + } } /* If we don't have the right type, try to convert it. */