This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, Fortran] Re-fix PR 31292
- From: Tobias Burnus <burnus at net-b dot de>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 31 Aug 2009 08:00:10 +0200
- Subject: Re: [PATCH, Fortran] Re-fix PR 31292
- References: <20090828213411.GA55045@troutmask.apl.washington.edu>
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.