This is an archive of the discontinued LLVM Phabricator instance.

[flang] Set default form if unspecified at end of OPEN statement
ClosedPublic

Authored by jeanPerier on Aug 31 2021, 5:29 AM.

Details

Summary

The standard specifies that the form must be set to a default at the
end of an open statement (C.7.4 point 2) where it was not specified.
Only in the case of a pre-connected unit can the form be deferred
until the first data transfer statement.

Set back the default form setting in OpenStatementState::EndIoStatement
that had been removed when deferring the pre-connected unit from setting
in 199a623ebf808a01e920ebd9904c99e633c33a1f.

Also return "UNDEFINED" instead of "UNKNOWN" to the FORM inquiry when the
form was not yet specified as defined in 12.10.2.12.

Related test: syntax 215a216.

Diff Detail

Event Timeline

jeanPerier created this revision.Aug 31 2021, 5:29 AM
jeanPerier requested review of this revision.Aug 31 2021, 5:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 5:29 AM

I don't really understand the runtime code, but all builds, tests, and (as far as I can tell) looks good.

klausler accepted this revision.Aug 31 2021, 9:43 AM
This revision is now accepted and ready to land.Aug 31 2021, 9:43 AM