Files
clang-p2996/flang/test/Semantics/call35.f90
Peter Klausler c704050929 [flang] Reduce implicit interface compatibility warnings due to length (#69385)
When a procedure with an implicit interface is called from two call
sites with distinct argument types, we emit a warning. This can lead to
a lot of output when the actual argument types are differing-length
character, and the warnings are less important since the procedure may
well have been defined with assumed-length character dummy arguments. So
let cases like CALL MYERROR('ab'); CALL MYERROR('abc') slide by without
a warning.
2023-10-31 10:12:16 -07:00

24 lines
724 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
subroutine s1
call ext(1, 2)
call myerror('abc')
end
subroutine s2
!WARNING: Reference to the procedure 'ext' has an implicit interface that is distinct from another reference: distinct numbers of dummy arguments
call ext(1.)
call myerror('abcd') ! don't warn about distinct lengths
end
subroutine s3
interface
!WARNING: The global subprogram 'ext' is not compatible with its local procedure declaration (incompatible procedure attributes: ImplicitInterface)
subroutine ext(n)
integer n
end
end interface
call ext(3)
!ERROR: Actual argument type 'REAL(4)' is not compatible with dummy argument type 'INTEGER(4)'
call ext(4.)
end