This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/45489] New: Default initialization of derived-type function result missing


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]