Commit bef016bf by Jerry DeLisle

re PR fortran/81296 (derived type I/o problem)

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.

	* gfortran.dg/dtio_12.f90: Update test.

From-SVN: r251254
parent 4f1aa9fb
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
......
......@@ -2214,18 +2214,24 @@ get_dtio_proc (gfc_typespec * ts, gfc_code * code, gfc_symbol **dtio_sub)
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.
......
......@@ -70,5 +70,11 @@ end module
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
close(10)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment