Bug 38289 - "procedure( ), pointer" rejected
Summary: "procedure( ), pointer" rejected
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2008-11-27 13:42 UTC by Tobias Burnus
Modified: 2008-11-29 13:39 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-11-27 22:16:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2008-11-27 13:42:09 UTC
Found at
http://de.wikibooks.org/wiki/Fortran:_Fortran_2003:_Zeiger

The following is rejected because of the space in "( )". With "()" it compiles:

  procedure( ), pointer :: pptr => null()
           1
Error: Syntax error in PROCEDURE statement at (1)
Comment 1 Tobias Burnus 2008-11-27 13:44:54 UTC
Something for you?
Comment 2 Mikael Morin 2008-11-27 21:12:28 UTC
Is this enough?

Index: decl.c
===================================================================
--- decl.c	(révision 142242)
+++ decl.c	(copie de travail)
@@ -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 (&current_ts, 0);
+  gfc_gobble_whitespace ();
   if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_ascii_char () == ')'))
     goto got_ts;
 
Comment 3 janus 2008-11-27 22:16:24 UTC
(In reply to comment #2)
> Is this enough?

I guess so :)
Comment 4 janus 2008-11-29 13:38:00 UTC
Subject: Bug 38289

Author: janus
Date: Sat Nov 29 13:36:35 2008
New Revision: 142276

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142276
Log:
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.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/proc_decl_1.f90

Comment 5 janus 2008-11-29 13:39:41 UTC
Fixed with r142276. Closing.