Index: flang/docs/Extensions.md =================================================================== --- flang/docs/Extensions.md +++ flang/docs/Extensions.md @@ -240,6 +240,16 @@ * The legacy extension intrinsic functions `IZEXT` and `JZEXT` are supported; `ZEXT` has different behavior with various older compilers, so it is not supported. +* f18 doesn't impose a limit on the number of continuation lines + allowed for a single statement. +* When a type-bound procedure declaration statement has neither interface + nor attributes, the "::" before the bindings is optional, even + if a binding has renaming with "=> proc". + The colons are not necessary for an unambiguous parse, C768 + notwithstanding. +* A type-bound procedure binding can be passed as an actual + argument corresponding to a dummy procedure and can be used as + the target of a procedure pointer assignment statement. ### Extensions supported when enabled by options Index: flang/lib/Semantics/check-call.cpp =================================================================== --- flang/lib/Semantics/check-call.cpp +++ flang/lib/Semantics/check-call.cpp @@ -596,6 +596,10 @@ argProcSymbol->name()); return; } + } else if (argProcSymbol->has()) { + evaluate::SayWithDeclaration(messages, *argProcSymbol, + "Procedure binding '%s' passed as an actual argument"_port_en_US, + argProcSymbol->name()); } } if (auto argChars{characteristics::DummyArgument::FromActual( Index: flang/lib/Semantics/pointer-assignment.cpp =================================================================== --- flang/lib/Semantics/pointer-assignment.cpp +++ flang/lib/Semantics/pointer-assignment.cpp @@ -307,6 +307,10 @@ symbol->name()); return false; } + } else if (symbol->has()) { + evaluate::SayWithDeclaration(context_.messages(), *symbol, + "Procedure binding '%s' used as target of a pointer assignment"_port_en_US, + symbol->name()); } } if (auto chars{Procedure::Characterize(d, context_)}) { Index: flang/test/Semantics/bindings03.f90 =================================================================== --- /dev/null +++ flang/test/Semantics/bindings03.f90 @@ -0,0 +1,26 @@ +! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror +! 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 + p => x%sub + !PORTABILITY: Procedure binding 'sub' passed as an actual argument + call sub2(x%sub) + contains + subroutine sub2(s) + procedure(sub) s + end subroutine +end