* trans-io.c (transfer_expr): Handle pointters.
testsuite/
* gfortran.dg/der_io_1.f90: New test.
From-SVN: r85738
+2004-08-10 Paul Brook <paul@codesourcery.com>
+
+ * trans-io.c (transfer_expr): Handle pointters.
+
2004-08-10 Paul Brook <paul@codesourcery.com>
PR fortran/16919
se->string_length =
TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp)));
}
- transfer_expr (se, &c->ts, gfc_build_addr_expr (NULL, tmp));
+ if (c->dimension)
+ gfc_todo_error ("IO of arrays in derived types");
+ if (!c->pointer)
+ tmp = gfc_build_addr_expr (NULL, tmp);
+ transfer_expr (se, &c->ts, tmp);
}
return;
+2004-08-10 Paul Brook <paul@codesourcery.com>
+
+ * gfortran.dg/der_io_1.f90: New test.
+
2004-08-10 Paul Brook <paul@codesourcery.com>
PR fortran/16919
--- /dev/null
+! { dg-do run }
+! IO of derived types containing pointers
+program der_io_1
+ type t
+ integer, pointer :: p
+ end type
+ integer, target :: i
+ type (t) v
+ character(4) :: s
+
+ v%p => i
+ i = 42
+ write (unit=s, fmt='(I2)'), v
+ if (s .ne. '42') call abort ()
+end program
+