Message ID | CAKwh3qh37C5FBAR-sfwQQOCfYmCJ4TfrGVLEmO87eaN9r6Rn+A@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Fri, Dec 02, 2016 at 04:24:20PM +0100, Janus Weil wrote: > > another simple fix for a rather old PR. This one adds a new check, in > order to provide better error messages than just "Unclassifiable > statement". > > Regtests cleanly on x86_64-linux-gnu. Ok for trunk? > OK.
2016-12-03 18:01 GMT+01:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: > On Fri, Dec 02, 2016 at 04:24:20PM +0100, Janus Weil wrote: >> >> another simple fix for a rather old PR. This one adds a new check, in >> order to provide better error messages than just "Unclassifiable >> statement". >> >> Regtests cleanly on x86_64-linux-gnu. Ok for trunk? >> > > OK. Thanks, Steve. Committed to trunk as r243223. Cheers, Janus
Index: gcc/fortran/primary.c =================================================================== --- gcc/fortran/primary.c (revision 243176) +++ gcc/fortran/primary.c (working copy) @@ -3298,6 +3298,15 @@ gfc_match_rvalue (gfc_expr **result) if (sym->result == NULL) sym->result = sym; + gfc_gobble_whitespace (); + /* F08:C612. */ + if (gfc_peek_ascii_char() == '%') + { + gfc_error ("The leftmost part-ref in a data-ref can not be a " + "function reference at %C"); + m = MATCH_ERROR; + } + m = MATCH_YES; break;