This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29216] New: Derived type components of function results are not initialised
- From: "stephan dot kramer at imperial dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Sep 2006 15:47:03 -0000
- Subject: [Bug fortran/29216] New: Derived type components of function results are not initialised
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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