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, OOP] PR 52552: ICE when trying to allocate non-allocatable object giving a dynamic type


On Fri, Jun 08, 2012 at 12:40:10PM +0200, Janus Weil wrote:
> 
> [Side note: The piece of code which I'm moving contains a FIXME
> comment, which I don't quite understand, so I'm not sure whether it is
> still valid. It was added by Steve in
> http://gcc.gnu.org/viewcvs?view=revision&revision=145331. Does anyone
> have an opinion on this?]
> 

It's been too long!  I believe Tobias is
right that the FIXME had to do allocatable
components and a walking one or more
link list.  

troutmask:sgk[207] gfc4x -o z foo.f90
troutmask:sgk[208] ./z
Bus error (core dumped)

program foo

   type bah
      real, allocatable :: x(:)
   end type bah

   type bar
      integer, allocatable :: i(:)
      type(bah), allocatable :: z(:)
   end type bar

   type(bar), allocatable :: a(:)

   allocate(a(2))              ! Should be ok
   allocate(a(1)%z(1)%x(42))   ! a(1)%z(1) not allocated, no error

end program foo




-- 
Steve


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