https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82622

--- Comment #6 from G. Steinmetz <gs...@t-online.de> ---
(In reply to kargl from comment #5)
> Is this valid code and should compile

It should be legal, IMO.  Note that "a" in z1.f90 is effectively unused
(the type parameters need not be used anywhere in the DT).


Side note: deleting attribute len from type t works :

$ cat z3.f90
program p
   type t
      integer :: n
   end type
   type t2(b)
      integer, len :: b
      type(t) :: r(b)
   end type
   type(t2(:)), allocatable :: x
   allocate (t2(3) :: x)

   x%r = [t(11), t(22), t(33)]
   print *, x%b, size(x%r)
   print *, x%r
end


$ gfortran-8-20171022 -static-libgfortran z3.f90
$ a.out
           3           3
          11          22          33

Reply via email to