This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45489] New: Default initialization of derived-type function result missing
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2010 21:01:10 -0000
- Subject: [Bug fortran/45489] New: Default initialization of derived-type function result missing
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program fails because the function result in "f" is never
initialized. It should be default initialized, which works using other
compilers.
type A
integer, pointer:: p => null ()
integer:: i=3
end type A
type(A):: x
x=f()
if (associated(x%p) .or. x%i /= 3) call abort ()
contains
function f() result (fr)
type(A):: fr
end function f
end
--
Summary: Default initialization of derived-type function result
missing
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 32834
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45489