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

Reply via email to