* PR 71156: interface inconsistency between module interface vs. submodule definition
@ 2016-05-17 0:46 Damian Rouson
0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2016-05-17 0:46 UTC (permalink / raw)
To: GCC-Fortran-ML; +Cc: Paul Richard Thomas
All,
As shown below, gfortran 6.1.0 rejects the application of the PURE
attribute consistently in a procedure interface body and in the
corresponding procedure definition. Conversely, gfortran accepts the
inconsistent approach (not shown) of using PURE in the interface body
but omitting PURE from the procedure definition. By contrast, the Cray
and Intel compilers behave opposite to gfortran: Intel and Cray accept the
consistent syntax below and reject the inconsistent syntax in which PURE
appears only in the interface body or only in the definition. If Intel and
Cray are correct, then gfortran is accepting invalid code and rejecting the
complementary valid code. It would be great if a fix could be applied
to the 6 and 7 branches.
Damian
$ cat consistency.f90
module my_interface
implicit none
interface
pure module subroutine f
end subroutine
end interface
end module
submodule(my_interface) my_implementation
implicit none
contains
pure module subroutine f
end subroutine
end submodule
$ gfortran -c consistency.f90
consistency.f90:12:28:
pure module subroutine f
1
Error: Duplicate PURE attribute specified at (1)
$ gfortran --version
GNU Fortran (MacPorts gcc6 6.1.0_0) 6.1.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-17 0:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17 0:46 PR 71156: interface inconsistency between module interface vs. submodule definition Damian Rouson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).