[Bug fortran/94408] Spurious error: ‘rw_nl_grid’ must be a module procedure or an external procedure
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94408 Thomas Koenig changed: What|Removed |Added CC||tkoenig at gcc dot gnu.org Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from Thomas Koenig --- This is now fixed on master, very probably as a result of the fix for PR96320. Since the test case is so similar, it is probably not necessary to commit the test case.
[Bug fortran/94408] Spurious error: ‘rw_nl_grid’ must be a module procedure or an external procedure
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94408 Dominique d'Humieres changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed||2020-07-11
[Bug fortran/94408] Spurious error: ‘rw_nl_grid’ must be a module procedure or an external procedure
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94408 --- Comment #4 from Richard Biener --- *** Bug 94407 has been marked as a duplicate of this bug. ***
[Bug fortran/94408] Spurious error: ‘rw_nl_grid’ must be a module procedure or an external procedure
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94408 --- Comment #3 from michalak at ucar dot edu --- Thank you, I've verified that removing the interface definitions works for this test program and provides a workaround for the original code from which this example was pulled. I'm not sure that the issue itself is resolved, however, since removing these interface definitions breaks the code for the Intel compiler. Will investigate further and provide additional context. -John
[Bug fortran/94408] Spurious error: ‘rw_nl_grid’ must be a module procedure or an external procedure
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.
[Bug fortran/94408] Spurious error: ‘rw_nl_grid’ must be a module procedure or an external procedure
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94408 --- Comment #1 from michalak at ucar dot edu --- 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