The attached patch has been tested on x86_64-*-freebsd.
OK to commit?
If an inquiry parameter cannot appear in a file IO statement
as a tag (see new testcase). The patch re-arranges the code
to prevent an ICE due to 'result->symtree = NULL;', checks
for a constant in a variable definition context, and takes
a different exit route to get better error messages.
2019-10-01 Steven G. Kargl <
[hidden email]>
PR fortran/91942
* io.c (match_vtag): Check for non-NULL result->symtree.
(match_out_tag): Check for invalid constant due to inquiry parameter.
(match_filepos): Instead of a syntax error, go to cleanup to get better
error messages.
2019-10-01 Steven G. Kargl <
[hidden email]>
PR fortran/91942
* gfortran.dg/pr91587.f90: Update dg-error regex.
* gfortran.dg/pr91942.f90: New test.
--
Steve