Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flang-rt/include/flang-rt/runtime/io-stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ class ChildListIoStatementState : public ChildIoStatementState<DIR>,
RT_API_ATTRS ChildListIoStatementState(
ChildIo &, const char *sourceFile = nullptr, int sourceLine = 0);
using ListDirectedStatementState<DIR>::GetNextDataEdit;
RT_API_ATTRS bool AdvanceRecord(int = 1);
RT_API_ATTRS int EndIoStatement();
};

Expand Down
20 changes: 17 additions & 3 deletions flang-rt/lib/runtime/io-stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,10 +1095,14 @@ ChildListIoStatementState<DIR>::ChildListIoStatementState(
}

template <Direction DIR>
bool ChildUnformattedIoStatementState<DIR>::Receive(
char *data, std::size_t bytes, std::size_t elementBytes) {
bool ChildListIoStatementState<DIR>::AdvanceRecord(int n) {
#if !defined(RT_DEVICE_AVOID_RECURSION)
return this->child().parent().Receive(data, bytes, elementBytes);
// Allow child NAMELIST input to advance
if (DIR == Direction::Input && this->mutableModes().inNamelist) {
return this->child().parent().AdvanceRecord(n);
} else {
return false;
}
#else
this->ReportUnsupportedChildIo();
#endif
Expand All @@ -1114,6 +1118,16 @@ template <Direction DIR> int ChildListIoStatementState<DIR>::EndIoStatement() {
return ChildIoStatementState<DIR>::EndIoStatement();
}

template <Direction DIR>
bool ChildUnformattedIoStatementState<DIR>::Receive(
char *data, std::size_t bytes, std::size_t elementBytes) {
#if !defined(RT_DEVICE_AVOID_RECURSION)
return this->child().parent().Receive(data, bytes, elementBytes);
#else
this->ReportUnsupportedChildIo();
#endif
}

template class InternalIoStatementState<Direction::Output>;
template class InternalIoStatementState<Direction::Input>;
template class InternalFormattedIoStatementState<Direction::Output>;
Expand Down
Loading