On 12/3/2018 11:25 AM, FortranFan wrote:
> For whatever it's worth, my reading of the standard leads me to believe the same i.e., it's that compiler which is in error.
>
> The code appears to conform to the standard; the implementation, my_foo, matches the abstract interface including in the BIND attribute characteristics and thus it's a valid actual argument to a procedure expecting a dummy argument with a procedure interface of foo.
The standard (F2018) says: "The characteristics of a procedure are the
classification of the procedure as a function or subroutine, whether it
is pure, whether it is elemental, whether it has the BIND attribute, the
characteristics of its dummy arguments, and the characteristics of its
function result if it is a function."
and
"If the interface of a dummy procedure is explicit, its characteristics
as a procedure (15.3.1) shall be the same as those of its effective
argument, except that a pure effective argument may be associated with a
dummy argument that is not pure and an elemental intrinsic actual
procedure may be associated with a dummy procedure (which cannot be
elemental)."
I see nothing in the posted code that violates this. I note that the
actual error message from the unnamed compiler was not shown - sometimes
the wording of the message isn't the same as the interpretation we were
given.
--
Steve Lionel
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn:
https://www.linkedin.com/in/stevelionel
Blog:
http://intel.com/software/DrFortran