Bug ID: 68174
           Summary: Length parameter in character allocation not
                    recognized as a scalar (regression from 5.2)
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot
          Reporter: neil.n.carlson at gmail dot com
  Target Milestone: ---

The following example is rejected by 6.0.0 20151025, but is accepted by 6.0.0
20150906 and 5.2.0.  It is valid Fortran.

% gfortran -c gfortran-bug-20151101A.f90 

       allocate(character(this%maxlen) :: this%mold)
Error: Scalar INTEGER expression expected at (1)

module example

  type :: foo
    class(*), allocatable :: mold
    integer :: maxlen
  end type


  subroutine pop (this)
    class(foo), intent(inout) :: this
    select type (uptr => this%mold)
    type is (character(*))
      allocate(character(this%maxlen) :: this%mold)
    end select
  end subroutine

end module

Reply via email to