This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, Fortran] PR38289/38290
- From: "Janus Weil" <jaydub66 at googlemail dot com>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 29 Nov 2008 14:09:30 +0100
- Subject: [Patch, Fortran] PR38289/38290
Hi all,
here is a rather trivial patch for two small problems with PROCEDURE
statements, which have been found by Tobias.
Regression tested on i686-pc-linux-gnu. Ok for trunk?
(The problem mentioned in PR38290 comment #2 I will fix later.)
Cheers,
Janus
2008-11-29 Janus Weil <janus@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
PR fortran/38289
PR fortran/38290
* decl.c (match_procedure_decl): Handle whitespaces.
* resolve.c (resolve_specific_s0): Bugfix in check for intrinsic
interface.
2008-11-29 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/38289
PR fortran/38290
* gfortran.dg/proc_decl_1.f90: Extended test case.
Index: gcc/testsuite/gfortran.dg/proc_decl_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/proc_decl_1.f90 (revision 142273)
+++ gcc/testsuite/gfortran.dg/proc_decl_1.f90 (working copy)
@@ -51,6 +51,11 @@ program prog
procedure(f) :: q ! { dg-error "may not be a statement function" }
procedure(oo) :: p ! { dg-error "must be explicit" }
+ procedure ( ) :: r
+ procedure ( up ) :: s ! { dg-error "must be explicit" }
+
+ call s
+
contains
subroutine foo(a,c) ! { dg-error "PROCEDURE attribute conflicts with INTENT attribute" }
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 142273)
+++ gcc/fortran/decl.c (working copy)
@@ -4094,6 +4094,7 @@ match_procedure_decl (void)
/* Get the type spec. for the procedure interface. */
old_loc = gfc_current_locus;
m = gfc_match_type_spec (¤t_ts, 0);
+ gfc_gobble_whitespace ();
if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_ascii_char () == ')'))
goto got_ts;
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 142273)
+++ gcc/fortran/resolve.c (working copy)
@@ -2748,7 +2748,8 @@ resolve_specific_s0 (gfc_code *c, gfc_sy
/* See if we have an intrinsic interface. */
if (sym->ts.interface != NULL && !sym->ts.interface->attr.abstract
- && !sym->ts.interface->attr.subroutine)
+ && !sym->ts.interface->attr.subroutine
+ && sym->ts.interface->attr.intrinsic)
{
gfc_intrinsic_sym *isym;