aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2019-01-31 03:37:16 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2019-01-31 03:37:16 +0000
commit474175e925a90166e1f4adcc83f9ddfbab1f841b (patch)
treee10c552e4cb0b02f4e9b384e86ec361ca06ce01b /gcc/fortran/io.c
parentf7478e4e33252da20e97138c7f1503e7706f300b (diff)
downloadgcc-474175e925a90166e1f4adcc83f9ddfbab1f841b.zip
gcc-474175e925a90166e1f4adcc83f9ddfbab1f841b.tar.gz
gcc-474175e925a90166e1f4adcc83f9ddfbab1f841b.tar.bz2
re PR fortran/52564 (Accepts invalid: Missing I/O list after comma)
2019-01-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/52564 * io.c (match_io): Add check for comma after '*' without subsequent IO list. * gfortran.dg/print_2.f90: New test. From-SVN: r268412
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index fce9228..95b3013 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -4172,6 +4172,23 @@ match_io (io_kind k)
else
gfc_current_locus = where;
}
+
+ if (gfc_match_char ('*') == MATCH_YES
+ && gfc_match_char(',') == MATCH_YES)
+ {
+ locus where2 = gfc_current_locus;
+ if (gfc_match_eos () == MATCH_YES)
+ {
+ gfc_current_locus = where2;
+ gfc_error ("Comma after * at %C not allowed without I/O list");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+ else
+ gfc_current_locus = where;
+ }
+ else
+ gfc_current_locus = where;
}
if (gfc_current_form == FORM_FREE)