2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/79312
* intrisic.c (gfc_convert_type_warn): Only set typespec for
empty array constructors which don't have it already.
2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/79312
* gfortran.dg/logical_assignment_1.f90: New test.
From-SVN: r250792
+2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/79312
+ * intrisic.c (gfc_convert_type_warn): Only set typespec for
+ empty array constructors which don't have it already.
+
2017-08-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45435
if (ts->type == BT_UNKNOWN)
goto bad;
- /* NULL and zero size arrays get their type here. */
- if (expr->expr_type == EXPR_NULL
- || (expr->expr_type == EXPR_ARRAY && expr->value.constructor == NULL))
+ /* NULL and zero size arrays get their type here, unless they already have a
+ typespec. */
+ if ((expr->expr_type == EXPR_NULL
+ || (expr->expr_type == EXPR_ARRAY && expr->value.constructor == NULL))
+ && expr->ts.type == BT_UNKNOWN)
{
/* Sometimes the RHS acquire the type. */
expr->ts = *ts;
+2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/79312
+ * gfortran.dg/logical_assignment_1.f90: New test.
+
2017-08-01 Martin Liska <mliska@suse.cz>
PR middle-end/70140
--- /dev/null
+! { dg-do compile }
+! PR 79312 - assigning a logical value to a real
+! is invalid.
+! Test case by John Harper.
+program emptyarray5
+ implicit none
+ real a(0)
+ a = [logical::] ! { dg-error "Can't convert LOGICAL" }
+ print *,size(a)
+end program emptyarray5