+2016-12-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/78350
+ * resolve.c (resolve_structure_cons): Remove the block that
+ tried to remove a charlen and rely on namespace cleanup.
+
2016-12-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/77903
gfc_constructor_append_expr (&cons->expr->value.constructor,
para, &cons->expr->where);
}
+
if (cons->expr->expr_type == EXPR_ARRAY)
{
- gfc_constructor *p;
- p = gfc_constructor_first (cons->expr->value.constructor);
- if (cons->expr->ts.u.cl != p->expr->ts.u.cl)
- {
- gfc_charlen *cl, *cl2;
-
- cl2 = NULL;
- for (cl = gfc_current_ns->cl_list; cl; cl = cl->next)
- {
- if (cl == cons->expr->ts.u.cl)
- break;
- cl2 = cl;
- }
-
- gcc_assert (cl);
-
- if (cl2)
- cl2->next = cl->next;
-
- gfc_free_expr (cl->length);
- free (cl);
- }
-
+ /* Rely on the cleanup of the namespace to deal correctly with
+ the old charlen. (There was a block here that attempted to
+ remove the charlen but broke the chain in so doing.) */
cons->expr->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL);
cons->expr->ts.u.cl->length_from_typespec = true;
cons->expr->ts.u.cl->length = gfc_copy_expr (comp->ts.u.cl->length);