+2018-12-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/88328
+ * io.c (resolve_tag_format): Add error for zero-sized array.
+ (gfc_resolve_dt): Manipulate gfc_current_locus to get sensible error
+ message locus.
+
2018-12-22 Steven G . Kargl <kargl@gcc.gnu.org>
PR fortran/85798
gfc_expr *r;
gfc_char_t *dest, *src;
+ if (e->value.constructor == NULL)
+ {
+ gfc_error ("FORMAT tag at %C cannot be a zero-sized array");
+ return false;
+ }
+
n = 0;
c = gfc_constructor_first (e->value.constructor);
len = c->expr->value.character.length;
{
gfc_expr *e;
io_kind k;
+ locus tmp;
/* This is set in any case. */
gcc_assert (dt->dt_io_kind);
k = dt->dt_io_kind->value.iokind;
- RESOLVE_TAG (&tag_format, dt->format_expr);
+ tmp = gfc_current_locus;
+ gfc_current_locus = *loc;
+ if (!resolve_tag (&tag_format, dt->format_expr))
+ {
+ gfc_current_locus = tmp;
+ return false;
+ }
+ gfc_current_locus = tmp;
+
RESOLVE_TAG (&tag_rec, dt->rec);
RESOLVE_TAG (&tag_spos, dt->pos);
RESOLVE_TAG (&tag_advance, dt->advance);
+2018-12-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/88328
+ * gfortran.dg/pr88328.f90: New test.
+
2018-12-21 Jan Hubicka <jh@suse.cz>
* g++.dg/ipa/devirt-30.C: Add dg-do.