This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi all, here is a patch that enhances the diagnostics for procedure-pointer assignments, so that procedure-pointer components that need an explicit interface are correctly rejected. Regtests cleanly on x86_64-linux-gnu. Ok for trunk? Cheers, Janus 2017-03-29 Janus Weil <janus@gcc.gnu.org> PR fortran/80046 * expr.c (gfc_check_pointer_assign): Check if procedure pointer components in a pointer assignment need an explicit interface. 2017-03-29 Janus Weil <janus@gcc.gnu.org> PR fortran/80046 * gfortran.dg/proc_ptr_comp_48.f90: New test case.
Attachment:
pr80046.diff
Description: Text document
! { dg-do compile } ! ! PR 80046: [F03] Explicit interface required: pointer argument ! ! Contributed by Joachim Herb <joachim.herb@gmx.de> program p implicit none type :: Node_t procedure(NodeCloner), nopass, pointer :: cloneProc => NULL() procedure(), nopass, pointer :: noIfc => NULL() end type interface subroutine NodeCloner( tgt, src ) import Node_t type(Node_t), pointer, intent(out) :: tgt type(Node_t), intent(in) :: src end subroutine end interface type(Node_t) :: node procedure(NodeCloner), pointer :: cloneNode procedure(), pointer :: noIfc cloneNode => node%noIfc ! { dg-error "Explicit interface required" } node%noIfc => cloneNode ! { dg-error "Explicit interface required" } noIfc => node%cloneProc ! { dg-error "Explicit interface required" } node%cloneProc => noIfc ! { dg-error "Explicit interface required" } node%cloneProc => node%noIfc ! { dg-error "Explicit interface required" } node%noIfc => node%cloneProc ! { dg-error "Explicit interface required" } ! the following cases are legal node%noIfc => node%noIfc node%cloneProc => node%cloneProc cloneNode => node%cloneProc node%cloneProc => cloneNode noIfc => node%noIfc node%noIfc => noIfc end
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |