Skip to content

Conversation

klausler
Copy link
Contributor

Whether list-directed child READ statements should be allowed to advance to further records is neither explicit in the standard nor consistent in existing Fortran implementations. We allow child namelist READ statements to advance, but not other list- directed child input.

This patch refines our interpretation of this case. Child namelist READ statements continue to be able to advance; in addition, non-namelist child READ statements can now advance if their parent READ statement is a list-directed input statement at the top level, or a child that could. But non-namelist list-directed child input taking place in a context with explicit format control won't advance to following records, so that the format-controlled parent READ statement can retain control over record advancement.

Also corrects two cases of record repositioning in numeric input editing, which were failing under child input because they weren't allowing for left tab limits.

Fixes #160351.

@llvmbot llvmbot added the flang Flang issues not falling into any other category label Sep 24, 2025
Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
All test cases marked against this issue are fixed.
Thanks.

Whether list-directed child READ statements should be allowed
to advance to further records is neither explicit in the standard
nor consistent in existing Fortran implementations.  We allow
child namelist READ statements to advance, but not other list-
directed child input.

This patch refines our interpretation of this case.  Child namelist
READ statements continue to be able to advance; in addition, non-namelist
child READ statements can now advance if their parent READ statement
is a list-directed input statement at the top level, or a child
that could.  But non-namelist list-directed child input taking
place in a context with explicit format control won't advance
to following records, so that the format-controlled parent READ
statement can retain control over record advancement.

Also corrects two cases of record repositioning in numeric input
editing, which were failing under child input because they weren't
allowing for left tab limits.

Fixes llvm#160351.
Copy link
Contributor

@akuhlens akuhlens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@klausler klausler merged commit 673e305 into llvm:main Sep 30, 2025
10 checks passed
@klausler klausler deleted the bug160351 branch September 30, 2025 17:35
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
)

Whether list-directed child READ statements should be allowed to advance
to further records is neither explicit in the standard nor consistent in
existing Fortran implementations. We allow child namelist READ
statements to advance, but not other list- directed child input.

This patch refines our interpretation of this case. Child namelist READ
statements continue to be able to advance; in addition, non-namelist
child READ statements can now advance if their parent READ statement is
a list-directed input statement at the top level, or a child that could.
But non-namelist list-directed child input taking place in a context
with explicit format control won't advance to following records, so that
the format-controlled parent READ statement can retain control over
record advancement.

Also corrects two cases of record repositioning in numeric input
editing, which were failing under child input because they weren't
allowing for left tab limits.

Fixes llvm#160351.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flang][runtime] DTIO failures

5 participants