From cd56666d7b6fa0b3214c226b2ae8a473537a009e Mon Sep 17 00:00:00 2001 From: Peter Klausler Date: Thu, 10 Apr 2025 10:39:27 -0700 Subject: [PATCH] [flang][runtime] Fix CUDA flang-rt build breakage (#135220) I used "std::nullopt" instead of the correct "Fortran::common::nullopt" in a recent patch, and you can get away with that only for CPU builds. Fix. --- flang-rt/include/flang-rt/runtime/io-stmt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flang-rt/include/flang-rt/runtime/io-stmt.h b/flang-rt/include/flang-rt/runtime/io-stmt.h index c9c193335c94..b6e95d155d01 100644 --- a/flang-rt/include/flang-rt/runtime/io-stmt.h +++ b/flang-rt/include/flang-rt/runtime/io-stmt.h @@ -156,7 +156,7 @@ public: if (at_ && at_ < limit_) { return *at_; } else { - return std::nullopt; + return Fortran::common::nullopt; } } RT_API_ATTRS void NextRecord(IoStatementState &io) { @@ -200,7 +200,7 @@ public: byteCount = ch ? 1 : 0; return ch; } else if (!field->MustUseSlowPath()) { - return std::nullopt; + return Fortran::common::nullopt; } } return GetCurrentCharSlow(byteCount);