diff --git a/flang-rt/lib/runtime/io-stmt.cpp b/flang-rt/lib/runtime/io-stmt.cpp
index 3260c8f83edb9..58fcd2377f563 100644
--- a/flang-rt/lib/runtime/io-stmt.cpp
+++ b/flang-rt/lib/runtime/io-stmt.cpp
@@ -1108,8 +1108,8 @@ ChildListIoStatementState
::ChildListIoStatementState(
template
bool ChildListIoStatementState::AdvanceRecord(int n) {
#if !defined(RT_DEVICE_AVOID_RECURSION)
- // Allow child NAMELIST input to advance
- if (DIR == Direction::Input && this->mutableModes().inNamelist) {
+ // Allow child list directed input to advance
+ if constexpr (DIR == Direction::Input) {
return this->child().parent().AdvanceRecord(n);
} else {
return false;