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

            Bug ID: 97036
           Summary: [F2018] ELEMENTAL RECURSIVE subprogram prefix
                    combination rejected
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ian_harvey at bigpond dot com
  Target Milestone: ---

F2018 removed the previous syntax restriction (F2008 C1245) on a subprogram
definition with both ELEMENTAL and RECURSIVE.

  MODULE m
    IMPLICIT NONE
  CONTAINS
    ELEMENTAL RECURSIVE SUBROUTINE foo
    END SUBROUTINE foo
  END MODULE m



$ gfortran --version
GNU Fortran (GCC) 11.0.0 20200905 (experimental)



$ gfortran -c 2020-09-13\ elemental-recursive.f90 -std=f2018
2020-09-13 elemental-recursive.f90:4:22:

    4 |   ELEMENTAL RECURSIVE SUBROUTINE foo
      |                      1
Error: ELEMENTAL attribute conflicts with RECURSIVE attribute at (1)
2020-09-13 elemental-recursive.f90:5:5:

    5 |   END SUBROUTINE foo
      |     1
Error: Expecting END MODULE statement at (1)

Reply via email to