[Bug fortran/79447] New: [F08] gfortran rejects valid & accepts invalid internal subprogram submodule
damian at sourceryinstitute dot org
gcc-bugzilla@gcc.gnu.org
Thu Feb 9 20:57:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79447
Bug ID: 79447
Summary: [F08] gfortran rejects valid & accepts invalid
internal subprogram submodule
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: damian at sourceryinstitute dot org
Target Milestone: ---
A recent build of gfortran 7 doesn’t allow an internal subprogram to be
contained inside a module subprogram when the subprogram is in a submodule and
is implemented with the “module procedure” keywords instead of “module
subroutine”. See below. gfortran 6.3.0 exhibits the same behavior. It would
be great if any fix can also be back-ported to the 6 branch.
ifort 17 compiles the code below without error.
Damian
$ cat procedure-contains.f90
module foo_interface
implicit none
interface
module subroutine foo()
end subroutine
end interface
end module foo_interface
submodule(foo_interface) foo_implementation
contains
module procedure foo
contains
module subroutine bar()
end subroutine
end procedure
!end subroutine ! gfortran accepts this invalid workaround
end submodule
$ gfortran procedure-contains.f90
procedure-contains.f90:15:7:
end procedure
1
Error: Expecting END SUBROUTINE statement at (1)
procedure-contains.f90:17:3:
end submodule
1
Error: Expecting END SUBROUTINE statement at (1)
f951: Error: Unexpected end of file in 'procedure-contains.f90'
$ gfortran --version
GNU Fortran (MacPorts gcc7 7-20170108_0) 7.0.0 20170108 (experimental)
More information about the Gcc-bugs
mailing list