Index: flang/runtime/format-implementation.h =================================================================== --- flang/runtime/format-implementation.h +++ flang/runtime/format-implementation.h @@ -386,7 +386,7 @@ ++offset_; } } else if (edit.descriptor == 'D' && Capitalize(PeekNext()) == 'T') { - // DT'iotype'(v_list) user-defined derived type I/O + // DT['iotype'][(v_list)] user-defined derived type I/O edit.descriptor = DataEdit::DefinedDerivedType; ++offset_; if (auto quote{static_cast(PeekNext())}; Index: flang/runtime/io-api.cpp =================================================================== --- flang/runtime/io-api.cpp +++ flang/runtime/io-api.cpp @@ -208,7 +208,7 @@ : "formatted input", false, DIR) ? &child->BeginIoStatement>( - *child, sourceFile, sourceLine) + *child, format, formatLength, sourceFile, sourceLine) : nullptr; } else { if (!unit.isUnformatted.has_value()) { Index: flang/runtime/io-error.cpp =================================================================== --- flang/runtime/io-error.cpp +++ flang/runtime/io-error.cpp @@ -59,10 +59,14 @@ void IoErrorHandler::Forward( int ioStatOrErrno, const char *msg, std::size_t length) { - SignalError(ioStatOrErrno); - if (ioStat_ != IostatOk && (flags_ & hasIoMsg)) { + if (ioStat_ != IostatOk && msg && (flags_ & hasIoMsg)) { ioMsg_ = SaveDefaultCharacter(msg, length, *this); } + if (ioStatOrErrno != IostatOk && msg) { + SignalError(ioStatOrErrno, "%.*s", static_cast(length), msg); + } else { + SignalError(ioStatOrErrno); + } } void IoErrorHandler::SignalErrno() { SignalError(errno); }