aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2017-04-23 15:49:16 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2017-04-23 15:49:16 +0000
commitc7eb642efa06145c84fc368284839fe6aa4b4650 (patch)
tree6fc389c4b330d8b2dc3bbc728b96c6383caac40f /gcc/fortran/io.c
parent60fc41bd415a631d7db82d56ed44d95677edf57e (diff)
downloadgcc-c7eb642efa06145c84fc368284839fe6aa4b4650.zip
gcc-c7eb642efa06145c84fc368284839fe6aa4b4650.tar.gz
gcc-c7eb642efa06145c84fc368284839fe6aa4b4650.tar.bz2
re PR fortran/80484 (Three syntax errors involving derived-type I/O)
2017-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/80484 * io.c (format_lex): Check for '/' and set token to FMT_SLASH. (check_format): Move FMT_DT checking code to data_desc section. * module.c (gfc_match_use): Include the case of INTERFACE_DTIO. PR fortran/80484 * gfortran.dg/dtio_29.f03: New test. From-SVN: r247084
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c106
1 files changed, 58 insertions, 48 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 60df44d..7ab897d 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -491,6 +491,11 @@ format_lex (void)
token = FMT_END;
break;
}
+ if (c == '/')
+ {
+ token = FMT_SLASH;
+ break;
+ }
if (c == delim)
continue;
unget_char ();
@@ -498,6 +503,11 @@ format_lex (void)
}
}
}
+ else if (c == '/')
+ {
+ token = FMT_SLASH;
+ break;
+ }
else
unget_char ();
}
@@ -687,54 +697,6 @@ format_item_1:
return false;
goto between_desc;
- case FMT_DT:
- t = format_lex ();
- if (t == FMT_ERROR)
- goto fail;
- switch (t)
- {
- case FMT_RPAREN:
- level--;
- if (level < 0)
- goto finished;
- goto between_desc;
-
- case FMT_COMMA:
- goto format_item;
-
- case FMT_LPAREN:
-
- dtio_vlist:
- t = format_lex ();
- if (t == FMT_ERROR)
- goto fail;
-
- if (t != FMT_POSINT)
- {
- error = posint_required;
- goto syntax;
- }
-
- t = format_lex ();
- if (t == FMT_ERROR)
- goto fail;
-
- if (t == FMT_COMMA)
- goto dtio_vlist;
- if (t != FMT_RPAREN)
- {
- error = _("Right parenthesis expected at %C");
- goto syntax;
- }
- goto between_desc;
-
- default:
- error = unexpected_element;
- goto syntax;
- }
-
- goto format_item;
-
case FMT_SIGN:
case FMT_BLANK:
case FMT_DP:
@@ -783,6 +745,7 @@ format_item_1:
case FMT_A:
case FMT_D:
case FMT_H:
+ case FMT_DT:
goto data_desc;
case FMT_END:
@@ -1004,6 +967,53 @@ data_desc:
break;
+ case FMT_DT:
+ t = format_lex ();
+ if (t == FMT_ERROR)
+ goto fail;
+ switch (t)
+ {
+ case FMT_RPAREN:
+ level--;
+ if (level < 0)
+ goto finished;
+ goto between_desc;
+
+ case FMT_COMMA:
+ goto format_item;
+
+ case FMT_LPAREN:
+
+ dtio_vlist:
+ t = format_lex ();
+ if (t == FMT_ERROR)
+ goto fail;
+
+ if (t != FMT_POSINT)
+ {
+ error = posint_required;
+ goto syntax;
+ }
+
+ t = format_lex ();
+ if (t == FMT_ERROR)
+ goto fail;
+
+ if (t == FMT_COMMA)
+ goto dtio_vlist;
+ if (t != FMT_RPAREN)
+ {
+ error = _("Right parenthesis expected at %C");
+ goto syntax;
+ }
+ goto between_desc;
+
+ default:
+ error = unexpected_element;
+ goto syntax;
+ }
+ break;
+
case FMT_F:
t = format_lex ();
if (t == FMT_ERROR)