Commit ff2c6bbb by Steven G. Kargl

re PR fortran/29403 ([4.1 only] print ('(a)') not working, print '(a) works)

2006-10-15  Steven G. Kargl  <kargl@gcc.gnu.org>

    PR fortran/29403
    * io.c (match_io):  Check for a default-char-expr for PRINT format.

From-SVN: r117764
parent b9ebbf54
2006-10-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/29403
* io.c (match_io): Check for a default-char-expr for PRINT format.
2006-10-15 Bernhard Fischer <aldot@gcc.gnu.org>
PR fortran/24767
......
......@@ -2744,7 +2744,8 @@ match_io (io_kind k)
where = gfc_current_locus;
comma_flag = 0;
current_dt = dt = gfc_getmem (sizeof (gfc_dt));
if (gfc_match_char ('(') == MATCH_NO)
m = gfc_match_char ('(');
if (m == MATCH_NO)
{
where = gfc_current_locus;
if (k == M_WRITE)
......@@ -2796,9 +2797,25 @@ match_io (io_kind k)
}
else
{
/* Error for constructs like print (1,*). */
if (k == M_PRINT)
goto syntax;
/* Before issuing an error for a malformed 'print (1,*)' type of
error, check for a default-char-expr of the form ('(I0)'). */
if (k == M_PRINT && m == MATCH_YES)
{
/* Reset current locus to get the initial '(' in an expression. */
gfc_current_locus = where;
dt->format_expr = NULL;
m = match_dt_format (dt);
if (m == MATCH_ERROR)
goto cleanup;
if (m == MATCH_NO || dt->format_expr == NULL)
goto syntax;
comma_flag = 1;
dt->io_unit = default_unit (k);
goto get_io_list;
}
}
/* Match a control list */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment