+2017-08-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/81296
+ * trans-io.c (get_dtio_proc): Add check for format label and set
+ formatted flag accordingly. Reorganize the code a little.
+
2017-08-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/81116
bool formatted = false;
gfc_dt *dt = code->ext.dt;
- if (dt && dt->format_expr)
+ if (dt)
{
- char *fmt;
- fmt = gfc_widechar_to_char (dt->format_expr->value.character.string,
- -1);
- if (strtok (fmt, "DT") != NULL)
+ char *fmt = NULL;
+
+ if (dt->format_label == &format_asterisk)
+ {
+ /* List directed io must call the formatted DTIO procedure. */
+ formatted = true;
+ }
+ else if (dt->format_expr)
+ fmt = gfc_widechar_to_char (dt->format_expr->value.character.string,
+ -1);
+ else if (dt->format_label)
+ fmt = gfc_widechar_to_char (dt->format_label->format->value.character.string,
+ -1);
+ if (fmt && strtok (fmt, "DT") != NULL)
formatted = true;
- }
- else if (dt && dt->format_label == &format_asterisk)
- {
- /* List directed io must call the formatted DTIO procedure. */
- formatted = true;
+
}
if (ts->type == BT_CLASS)
+2017-08-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/81296
+ * gfortran.dg/dtio_12.f90: Update test.
+
2017-08-21 Nathan Sidwell <nathan@acm.org>
* g++.dg/template/pr81899.C: Fix c++03.
if (trim (msg) .ne. "42") call abort
rewind (10)
write (10,"(DT)") child (77) ! The original testcase
+ rewind (10)
+ read (10, *) msg
+ if (trim (msg) .ne. "77") call abort
+ rewind (10)
+ write (10,40) child (77) ! Modified using format label
+40 format(DT)
rewind (10)
read (10, *) msg
if (trim (msg) .ne. "77") call abort