https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70031
            Bug ID: 70031
           Summary: Error in recursive module subroutine declaration if
                    declared as "module recursive"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

As reported by  on 

This works:

module test
  Interface
    Recursive Module Subroutine sub1 (x)
      Integer, Intent (InOut) :: x
    End Subroutine sub1
  End Interface
end module test

submodule(test) testson
  integer :: n = 10
contains
  Module Procedure sub1
    If (x < n) Then
        x = x + 1
        Print *, 'x = ', x
        Call sub1 (x)
    End If
  End Procedure sub1
end submodule testson

  use test
  integer :: x = 5
  call sub1(x)
end

but inverting the order in the interface declaration to read
  Module Recursive Subroutine sub1 (x)

causes the error
../submodule.f90:3:4:

     module Recursive Subroutine sub1 (x)
    1
Error: Unclassifiable statement at (1)

Reply via email to