$ cat erik.f90 
program test
  type t
    real :: a = 3.1
  end type t
  type(t), pointer :: p
  type(t), allocatable :: q(:)

  allocate(p)
  print *, p%a

  allocate(q(1))
  print *, q(1)%a
end program test

$ gfortran erik.f90
$ a.out
   0.000000    
   0.000000     


The output I had expected is
   3.100000    
   3.100000    
given by ifort 8.1

-- 
           Summary: No initialization of derived type pointers/allocatables
                    when allocated
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: erik dot edelmann at iki dot fi
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to