This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH, Fortran] Re-fix PR 31292


Am 28.08.2009 23:34, schrieb Steve Kargl:
> 2009-08-28  Steven G. Kargl <kargl@gcc.gnu.org>
>
> 	* gfortran.dg/module_procedure_1.f90: New test.
>
> 2009-08-28  Steven G. Kargl <kargl@gcc.gnu.org>
>
> 	* fortran/decl.c: Module procedure can appear in PROGRAM and
> 	subprogram scope.
>   

I think your patch is OK, however, one needs to add a bit more to fully
fix the problem, see test case below.

Tobias


module m
contains
  subroutine modSub()
  end subroutine modSub
end module m

use m
implicit none
  intrinsic sin
  interface gen2
    module procedure sin ! Invalid per C1208, but not detected
!     procedure sin ! OK - valid and accepted
  end interface gen2
  interface gen
    module  procedure modSub ! OK (valid and now accepted)
    module procedure intSub ! Invalid per C1208, gives
         ! misleading error "INTERNAL-PROC procedure at (1) is already
         ! declared as MODULE-PROC procedure"
!    procedure intSub ! OK - valid and accepted
  end interface
contains
  subroutine intSub(a)
    integer :: a
  end subroutine intSub
end

C1208 (R1206) If MODULE appears in a procedure-stmt, each procedure-name
in that statement shall be accessible in the current scope as a
module procedure.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]