[PATCH] D119404: [flang] Allow mixed association of procedure pointers and targets
Jean Perier via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 10 00:27:31 PST 2022
jeanPerier added inline comments.
================
Comment at: flang/lib/Evaluate/tools.cpp:977
+ // match. That's the case if the target procedure has an implicit
+ // interface. But this case is allowed by several other compilers.
} else if (!lhsProcedure->HasExplicitInterface() &&
----------------
I agree that nag/gfortran/ifort/nvfortran do not complain if the pointer explicit interface is compatible with an implicit interface (`CanBeCalledViaImplicitInterface()`), but it seems only nvfortran allows the cases where the explicit interface cannot be called via implicit interface. The following program is refused by nag/ifort/gfortran/xlf (and I think we should too, unless they are programs that really needs it):
```
module m
interface
subroutine requires_explicit_iface(p)
real, pointer :: p(:)
end subroutine
end interface
contains
subroutine test
procedure(requires_explicit_iface), pointer :: p
external :: s_external
p => s_external
end subroutine
end module
```
So you could still complain here if `!lhsProcedure->CanBeCalledViaImplicitInterface()` IMHO.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119404/new/
https://reviews.llvm.org/D119404
More information about the llvm-commits
mailing list