https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89782

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #3)
> In fortran/io.c we are excluding this case since it is not a variable. So we
> should be able to accept in the case of READ from an expression type
> constant and reject an attempt to WRITE to it. (at least intuitively it
> would seem OK to do)
> 
> I have a partial patch.  I want to make sure there is no constraint in the
> standards.  "scalar character variable" is fairly specific in standardese.
> My guess is we never did the check for the vector case so it just works.

The Fortran standard is very clear.  Accepting a named constant
is an error.

R1201 io-unit                 is file-unit-number
                              or *
                              or internal-file-variable
R1202 file-unit-number        is scalar-int-expr

R1203 internal-file-variable  is char-variable

A named constant is not a variable.

Reply via email to