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

kargl at gcc dot gnu.org changed:

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

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to michalak from comment #1)
> Here is a slightly more simplified version of the test.F90 program that
> still demonstrates the error with gcc 9.1.0 (below). The namelist_t type
> from the previous reproducer code turns out not to be necessary and has been
> removed from the example. Commenting out the indicated line causes the error
> to go away.  Thanks, -John 
> 
> ===
> 
> module mod_input
>   type config_t
>     integer :: domain_id
>     contains
>     procedure :: init      => rw_config
>     procedure :: rw_nl_grid
>   end type config_t
>   interface
>     module subroutine rw_config (this,iunit)
>       implicit none
>       class (config_t) :: this
>       integer, intent(in), optional :: iunit
>     end subroutine rw_config
>     module subroutine rw_nl_grid ( this, iunit )
>       implicit none
>       class (config_t) :: this
>       integer, optional, intent(in) :: iunit
>     end subroutine rw_nl_grid
>   end interface
>   contains
>     module subroutine rw_config (this,iunit)
>       implicit none
>       class (config_t) :: this
>       integer, intent(in), optional :: iunit
>       call this%rw_nl_grid     ! comment this out to make error go away
>     end subroutine rw_config
>     module subroutine rw_nl_grid ( this, iunit )
>       implicit none
>       class (config_t) :: this
>       integer, optional, intent(in) :: iunit
>     end subroutine rw_nl_grid
> end module mod_input
> 
> module neptune_write_native
>   contains
>   subroutine Run
>     use mod_input
>     type(config_t)            :: config
>   end subroutine Run
> end module neptune_write_native

Although your code is likely conforming (I don't know as I don't
you the construct you're trying to exploit), if you remove the
interface block (which is redundant as contained procedures within
a module have explict interfaces) then the code compiles.

Hopefully, someone who writes similar code will take an interest
in this issue and submit a patch.  Good luck.

Reply via email to