[Bug fortran/41859] ICE on invalid expression involving DT with pointer components in I/O
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Oct 28 22:32:00 GMT 2009
------- Comment #1 from burnus at gcc dot gnu dot org 2009-10-28 22:32 -------
"If a list item of derived type in an unformatted input/output statement is not
processed by a user-defined derived-type input/output procedure (9.5.3.7), and
if any subobject of that list item would be processed by a user-defined
derived-type input/output procedure, the list item is treated as if all of the
components of the object were specified in the list in component order
(4.5.3.5); those components shall be accessible in the scoping unit containing
the input/output statement and shall not be pointers or allocatable.
If a list item of derived type in a formatted input/output statement is not
processed by a user-defined derived-type input/output procedure, that list item
is treated as if all of the components of the list item were specified in the
list in component order; those components shall be accessible in the scoping
unit containing the input/output statement and shall not be pointers or
allocatable.
If a derived-type list item is not treated as a list of its individual
components, that list itemÂs ultimate components shall not have the POINTER or
ALLOCATABLE attribute unless that list item is processed by a user-defined
derived-type input/output procedure." (F2003, 9.5.2).
* * *
Note: The scope issue is also violated as the following example shows. Other
compilers get this right:
error #7300: This derived-type object in an input-output list cannot have
private components.
Error: Data transfer element at (1) cannot have PRIVATE components
Error: Derived type T in io-list has PRIVATE components
module inputdom
type t
PRIVATE ! <<<<<<<<<
integer :: i
end type t
end module
module m
use inputdom
contains
subroutine getstructinput()
implicit none
print *, (foo()) ! <<<<<<<<<<
end subroutine
function foo()
type(t), pointer :: foo
foo => null()
end function foo
end module m
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41859
More information about the Gcc-bugs
mailing list