The check should be done in resolve_global_procedure. NAG has: Error: fjkff.f90: Inconsistent INTERFACE block for procedure FOO from $main$ Argument X (no. 1) should be an assumed-shape array g95 has: Error: Passing array at (1) to assumed-shape actual argument at (2) via an implicit interface Example: subroutine foo(x) integer :: x(:) end subroutine foo interface subroutine foo(x) integer :: x(1) end subroutine foo end interface call foo([1]) end
Related - the original version of gfortran.dg/char_result_4.f90 shows: pure elemental function double (x) 1 Error: ELEMENTAL procedure 'double' at (1) must have an explicit interface Expected: This message is shown for the CALL to the procedure and not for the definition. Note 1: I quickly tried to generate a minimal example, but I did not succeed. Note 2: As part of PR 40873 the example will be fixed, please remember this when testing. * * * Another item to do argument checking if there is an INTERFACE present. A simple use check cannot be done as the INTERFACE might have different argument names than the real procedure, which will fail. Thus gfc_procedure_use needs to be augmented by having a mode which goes trough the list one-to-one without checking the presence of other arguments. (Assumes that list has been reordered). Or, one adds a function which simply compares the formal arguments, which is probably the better approach.
subroutine foo(x) integer, allocatable :: x end subroutine integer, allocatable :: ptr call foo(ptr) end Error: Dummy argument 'x' of procedure 'foo' at (1) has an attribute that requires an explicit interface for this procedure Expected: Could be more explicit, maybe. * * * subroutine foo(x) integer, allocatable :: x end subroutine interface subroutine foo(x) integer :: x end subroutine end interface integer, allocatable :: ptr call foo(ptr) end Expected: Mismatched interface is detected. * * * subroutine foo(x) integer, allocatable :: x end subroutine interface subroutine foo(x) integer :: x end subroutine end interface integer :: ptr call foo(ptr) end Expected: Mismatched actual argument is detected as well.
Same as #27318.
Bugger, should have been closed as dupe, 2nd try. *** This bug has been marked as a duplicate of bug 27318 ***