This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch,fortran] PR32644 [4.3 Regression] "CHARACTER*1, c" produces "Unclassifiable statement"
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 07 Jul 2007 16:17:17 -0700
- Subject: [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