[Bug fortran/29216] New: Derived type components of function results are not initialised
stephan dot kramer at imperial dot ac dot uk
gcc-bugzilla@gcc.gnu.org
Mon Sep 25 15:47:00 GMT 2006
The derived type components of function results are not initialised according
to their initialisation statements. This follows from the following code:
program test
implicit none
type A
integer, pointer:: p => null()
integer:: i=3
end type A
type(A):: x,y
print *,associated(x%p), x%i
x=f()
print *,associated(x%p), x%i
contains
function f()
type(A):: f
print *, associated(f%p), f%i
end function f
end program
and run-time output:
F 3
T -1073745616
T -1073745616
--
Summary: Derived type components of function results are not
initialised
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: stephan dot kramer at imperial dot ac dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29216
More information about the Gcc-bugs
mailing list