[Bug fortran/35810] [F2003] Automatic reallocation on assignment to allocatable variables

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 3 09:05:00 GMT 2008



------- Comment #1 from burnus at gcc dot gnu dot org  2008-04-03 09:04 -------
One thing to add: Seemingly gfortran supports reallocation for allocatable
components (by itself a F2003 feature) using the constructor (see example), but
not without constructor.

Additionally, while a simple example (as below) works, the long example in the
thread above is failing in some cases. (See link.)

type t
  integer, allocatable :: a(:)
end type t
type(t) :: a
allocate(a%a(1))
print *, size(a%a) ! print 1  (OK)
a = t([1,2,3])
print *, size(a%a) ! prints 2 (OK)
end


-- 


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



More information about the Gcc-bugs mailing list