Message ID | 12de47dd-d8c7-bef3-573b-814a34222417@charter.net |
---|---|
State | New |
Headers | show |
Series | [fortran] PR52564 Accepts invalid: Missing I/O list after comma | expand |
On Wed, Jan 30, 2019 at 05:29:52PM -0800, Jerry DeLisle wrote: > The attached patch is straight-forward and self explanatory. > > Regression tested on x86-64-pc-linux-gnu. Test case attached. > > OK for trunk? > Yes. Thanks for patch.
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index fce9228c302..95b30132203 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)