diff --git a/flang/runtime/namelist.cpp b/flang/runtime/namelist.cpp --- a/flang/runtime/namelist.cpp +++ b/flang/runtime/namelist.cpp @@ -263,6 +263,7 @@ auto *listInput{io.get_if>()}; RUNTIME_CHECK(handler, listInput != nullptr); // Check the group header + io.BeginReadingRecord(); std::optional next{io.GetNextNonBlank()}; if (!next || *next != '&') { handler.SignalError(