llvm-project/flang/test/Semantics/bindings03.f90
Andre Kuhlenschmidt 83b462af17
[flang][CLI] Have the CLI hint the flag to disable a warning (#144767)
Adds a hint to the warning message to disable a warning and updates the
tests to expect this.

Also fixes a bug in the storage of canonical spelling of error flags so
that they are not used after free.
2025-06-30 10:17:05 -07:00

27 lines
663 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic
! Confirm a portability warning on use of a procedure binding apart from a call
module m
type t
contains
procedure :: sub
end type
contains
subroutine sub(x)
class(t), intent(in) :: x
end subroutine
end module
program test
use m
procedure(sub), pointer :: p
type(t) x
!PORTABILITY: Procedure binding 'sub' used as target of a pointer assignment [-Wbinding-as-procedure]
p => x%sub
!PORTABILITY: Procedure binding 'sub' passed as an actual argument [-Wbinding-as-procedure]
call sub2(x%sub)
contains
subroutine sub2(s)
procedure(sub) s
end subroutine
end