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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org
             Blocks|                            |82173

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Original test now gives 
    6 |     character(clen), pointer :: cptr(:) => null()
      |                                                 1
Error: The component ‘cptr’ at (1) of derived type ‘charptr’ has paramterized
type or array length parameters, which is not compatible with a default
initializer

with or without line 17.

That in comment 2 compiles OK. Extending it to:
subroutine uc
  type z4(pj)
     integer, len :: pj
  end type z4
  type tp(q6)
     integer, len :: q6
     type(z4(q6)), pointer :: kz
  end type tp
  type(tp(:)), allocatable :: ng
  type(z4(4)), target :: tgt
  tgt%d = [1,2,3,4]
  ng = tp(4)(tgt)
  print *, ng%kz%pj, ng%kz%d
end subroutine uc
  call uc
end
runs and gives the anticipated result.

The one in comment 4 compiles and runs with or without the commented out lines.

Closing as fixed on 16-branch.

Paul


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82173
[Bug 82173] [meta-bug] [PDT] Parameterized derived type errors

Reply via email to