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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #6 from kargl at gcc dot gnu.org ---
Reduced to something less than 3000 lines of code.  Sheesh.

module m_string
   implicit none
   type t_string
      character(len=:), allocatable :: buffer
      contains
         generic :: assignment(=) => string_assign_from_string
         procedure, private :: string_assign_from_string
   end type t_string
   contains
      subroutine string_assign_from_string( left, right )
         class(t_string), intent(inout) :: left
         type(t_string), intent(in) :: right
      end subroutine string_assign_from_string
end module m_string

module m_msg
   use m_string
   implicit none
   type t_msg
      integer :: code = 0
      type(t_string) :: text, mod, proc
      contains
         procedure :: get_code => msg_code_get
   end type t_msg
   contains
      elemental function msg_code_get( this ) result(res)
         class(t_msg), intent(in) :: this
         integer :: res
         res = this%code
      end function msg_code_get
end module m_msg

module m_messages
   use m_msg
   implicit none
   type t_messages
      integer :: unit = -1
      type(t_msg), dimension(:), allocatable :: error_buffer
      type(t_msg), dimension(:), allocatable :: warning_buffer
   end type t_messages
   contains
      subroutine messages_push_back( array, msg )
         type(t_msg), dimension(:), allocatable, intent(inout) :: array
         type(t_msg), intent(in) :: msg
         integer idx
         idx = count(array%get_code() /= 0) + 1
         array(idx) = msg
      end subroutine messages_push_back
end module m_messages

Reply via email to