+2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/83224
+ * frontend-passes.c (create_var): Also handle
+ character arrays, handling deferred lenghts.
+
2017-12-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82605
}
deferred = 0;
- if (e->ts.type == BT_CHARACTER && e->rank == 0)
+ if (e->ts.type == BT_CHARACTER)
{
gfc_expr *length;
else
{
symbol->attr.allocatable = 1;
+ symbol->ts.u.cl->length = NULL;
+ symbol->ts.deferred = 1;
deferred = 1;
}
}
result = gfc_get_expr ();
result->expr_type = EXPR_VARIABLE;
- result->ts = e->ts;
+ result->ts = symbol->ts;
result->ts.deferred = deferred;
result->rank = e->rank;
result->shape = gfc_copy_shape (e->shape, e->rank);
+2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/83224
+ * gfortran.dg/dependency_51.f90: New test.
+
2017-12-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82605
--- /dev/null
+! { dg-do run }
+! PR 83224 - dependency mishandling with an array constructor
+! Original test case by Urban Jost
+program dusty_corner
+ implicit none
+ character(len=:),allocatable :: words(:)
+ integer :: n
+
+ words=[character(len=3) :: 'one', 'two']
+ n = 5
+ words=[character(len=n) :: words, 'three']
+ if (any(words /= [ "one ", "two ", "three"])) call abort
+
+end program dusty_corner