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]

[patch,fortran] PR32644 [4.3 Regression] "CHARACTER*1, c" produces "Unclassifiable statement"


:ADDPATCH fortran:

The attached patch fixes this problem. It is OK to eat the comma, but the comma not being there and not matching the iso_c_binding statement is not a match error.

Regression tested on x86-64-Gnu/Linux.

Thanks to Steve Kargl for spotting the location of this bug.

OK for trunk?

Regards,

Jerry

2007-07-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR fortran/32644
	* decl.c (match_attr_spec): Don't return MATCH_ERROR if comma found and
	gfc_match_bind_c does not return MATCH_YES.

Index: decl.c
===================================================================
--- decl.c	(revision 126449)
+++ decl.c	(working copy)
@@ -2507,15 +2507,11 @@ match_attr_spec (void)
 	      /* Chomp the comma.  */
 	      peek_char = gfc_next_char ();
 	      /* Try and match the bind(c).  */
-	      if (gfc_match_bind_c (NULL) == MATCH_YES)		 
+	      if (gfc_match_bind_c (NULL) == MATCH_YES)
 		d = DECL_IS_BIND_C;
-	      else
-		{
-		  return MATCH_ERROR;
-		}
 	    }
 	}
-       
+
       if (d == DECL_NONE || d == DECL_COLON)
 	break;
 
! { dg-do compile }
! PR32644 "CHARACTER*1, c" produces "Unclassifiable statement"
program f
character*1, c
end program f

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