This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH, Fortran] Derived type finalization: Already somewhat useable...


Hi Daniel,

I started playing around with finalize and saw that compiling the
following invalid program causes an ICE. (Actually, the program is
valid Fortran 2003, but gfortran does not yet support allocatable
scalars.)


 type(t),allocatable :: x
                        1
Error: Scalar object 'x' at (1) may not be ALLOCATABLE
aa.f90:16.11:

 allocate(x)
          1
Error: Array specification required in ALLOCATE statement at (1)
aa.f90:10: internal compiler error: in gfc_finalize_expr, at
fortran/expr.c:3797



module m
type t
contains
  final :: one
end type t
contains
subroutine one(x)
  type(t) :: x
   print *, 'one'
end subroutine one
end module m

use m
 type(t),allocatable :: x
 allocate(x)
end

Tobias


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