[flang-commits] [PATCH] D144205: [flang][runtime] Allow record advancement in child I/O via '/' control edit descriptor

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Feb 16 10:53:32 PST 2023


klausler created this revision.
klausler added a reviewer: clementval.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

My earlier misreading of the Fortran standards had convinced me that child I/O

- meaning the use of user-defined subroutines via generic interfaces to implement

data transfer statements -- was not allowed to advance the current record in the
ultimate unit of the original (non-child parent) data transfer statement.
This turns out to be wrong, so forward AdvanceRecord() from ChildFormattedIoStatement<>
to its parent I/O statement rather than implementing it as a no-op.


https://reviews.llvm.org/D144205

Files:
  flang/runtime/io-stmt.cpp


Index: flang/runtime/io-stmt.cpp
===================================================================
--- flang/runtime/io-stmt.cpp
+++ flang/runtime/io-stmt.cpp
@@ -879,8 +879,8 @@
 }
 
 template <Direction DIR, typename CHAR>
-bool ChildFormattedIoStatementState<DIR, CHAR>::AdvanceRecord(int) {
-  return false; // no can do in a child I/O
+bool ChildFormattedIoStatementState<DIR, CHAR>::AdvanceRecord(int n) {
+  return this->child().parent().AdvanceRecord(n);
 }
 
 template <Direction DIR>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144205.498082.patch
Type: text/x-patch
Size: 496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230216/f3581c28/attachment.bin>


More information about the flang-commits mailing list