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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Note that if I do the same modification as in comment 3 to the original test

module SingleLinkedListClass
  implicit none
  private

  integer, parameter :: intG_IK = SELECTED_INT_KIND (8)

  type SingleLinkItem
    integer (kind=4), public        :: intTag
    logical (kind=4), public        :: blnIsPointer
    class (*),              pointer :: udtData => NULL ()
    type (SingleLinkItem),  pointer :: udtNext => NULL()
  contains
    final :: Destroy
  end type SingleLinkItem

  type SingleLinkedList
     private
     integer, allocatable :: Dummy
     type (SingleLinkItem), pointer :: udtFirstLink => NULL ()
     integer (intG_IK)    , public  :: intItemCount = 0
   contains
     procedure, public,  pass(this) :: GoToStart
  end type SingleLinkedList

contains
  function GoToStart (this) result (intSuccess)
    implicit none 
    class (SingleLinkedList), intent (inout) :: this
    integer (intG_IK) :: intSuccess = -1
  end function GoToStart

  subroutine Destroy (this)
    implicit none
    type(SingleLinkItem), intent(inout) :: this
    integer(kind=4)                     :: intStat
    DEALLOCATE (this%udtData, STAT=intStat)
    this%intTag = 0
  end subroutine Destroy

end module SingleLinkedListClass

the ICE is gone, but I get the following error

   function GoToStart (this) result (intSuccess)
                                               1

Error: Function result 'intsuccess' at (1) cannot have an initializer

I don't understand.

Reply via email to