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
On Mon, Aug 31, 2009 at 03:22:29PM -0700, Steve Kargl wrote:
> On Mon, Aug 31, 2009 at 02:58:18PM -0700, Steve Kargl wrote:
> > On Mon, Aug 31, 2009 at 08:00:10AM +0200, Tobias Burnus wrote:
> > > 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.
> > >
> >
> > I'll hold off on committing my patch until I investigate
> > some the issues you point out below.
> >
> > > module m
> > > contains
> > > subroutine modSub()
> > > end subroutine modSub
> > > end module m
> > >
> > > use m
> > > implicit none
> > > intrinsic sin
> >
> > If the above explicit 'intrinsic sin' statement is missing, then ...
> >
> > > interface gen2
> > > module procedure sin ! Invalid per C1208, but not detected
> >
> > is this still invalid? I would assume the answer is "yes"
> > because sin is implicitly given the intrinsic attribute.
> >
> > >
> > > 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.
> >
>
> How's this
>
> troutmask:sgk[213] gfc4x -c t2.f90
> t2.f90:8.23:
>
> module procedure sin ! Invalid per C1208, but not detected
> 1
> Error: Intrinsic procedure at (1) cannot be a MODULE PROCEDURE
>
Nothing like a monologue. In the absense of an 'intrinsic sin'
statement, the sin symbol has not been resolved to be an intrinsic
procedure. Thus, gfortran generates an error message:
t2.f90:8.23:
module procedure sin ! Invalid per C1208, but not detected
1
Error: Procedure 'sin' in generic interface 'gen2' at (1) is neither
function nor subroutine
I have a patch that moves the locus to point at sin, i.e.,
t2.f90:8.23:
module procedure sin ! Invalid per C1208, but not detected
1
Error: Procedure 'sin' in generic interface 'gen2' at (1) is neither
function nor subroutine
--
Steve