[Bug fortran/25217] New: Derived type dummy argument having intent(out) attribute

sudeshc at noida dot hcltech dot com gcc-bugzilla@gcc.gnu.org
Fri Dec 2 04:17:00 GMT 2005


1. There is a procedure (function/subroutine) call. A variable of derived type
is passed as actual argument to this procedure. One of the components of
derived type is default initialized.
2. Corresponding dummy argument has INTENT(OUT) attribute. 

When above two conditions are satisfied then according if dummy argument is
accessed in procedure it should be default initialized. But this is NOT the
behaviour of gfortran. 

e.g. consider following example

program main
type drv
integer::a(10)=10
end type drv
type (drv)::aa
aa%a=100
ret=fun(aa)
contains
function fun(fa)
type (drv),intent(out)::fa !---------(A) integer::fun print *,fa%a
fun=fa%a(1)
end function fun
end

Please see line marked (A). Here "fa" should be reinitialized to default value
10. But this is not happening in gfortran.


-- 
           Summary: Derived type dummy argument having intent(out) attribute
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sudeshc at noida dot hcltech dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25217



More information about the Gcc-bugs mailing list