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

35 lines
1.2 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
! Confirm enforcement of constraint C723 in F2018 for procedure pointers
module m
contains
subroutine subr(parg)
!PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability]
procedure(character(*)), pointer :: parg
!ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, character named constant, or external function result
procedure(character(*)), pointer :: plocal
print *, parg()
plocal => parg
call subr_1(plocal)
end subroutine
subroutine subr_1(parg_1)
!PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability]
procedure(character(*)), pointer :: parg_1
print *, parg_1()
end subroutine
end module
character(*) function f()
f = 'abcdefgh'
end function
program test
use m
character(4), external :: f
procedure(character(4)), pointer :: p
p => f
call subr(p)
end