llvm-project/flang/test/Semantics/generic-error.f90
Peter Klausler e34d603f18
[flang] More information on generic resolution failures (#164738)
When a generic procedure reference does not match any of its specific
procedures, run through them and emit the errors for each attempted
match, so that the user has more information to resolve the problem by
adjusting the actual arguments.
2025-10-24 14:14:59 -05:00

22 lines
662 B
Fortran

! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
module m
interface generic
procedure :: sub1, sub2
end interface
contains
subroutine sub1(x)
end
subroutine sub2(j)
end
end
program test
use m
!CHECK: error: No specific subroutine of generic 'generic' matches the actual arguments
!CHECK: Specific procedure 'sub1' does not match the actual arguments
!CHECK: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'REAL(4)'
!CHECK: Specific procedure 'sub2' does not match the actual arguments
!CHECK: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'INTEGER(4)'
call generic(1.d0)
end