[flang-commits] [flang] [flang] fix compiler report error on windows (PR #76491)

via flang-commits flang-commits at lists.llvm.org
Wed Dec 27 23:15:14 PST 2023


https://github.com/lipracer created https://github.com/llvm/llvm-project/pull/76491

None

>From 25c83d281bdfaae19da1c31e0acf1c54751ec584 Mon Sep 17 00:00:00 2001
From: lipracer <lipracer at gmail.com>
Date: Thu, 28 Dec 2023 15:14:01 +0800
Subject: [PATCH] [flang] fix compiler report error on windows

---
 flang/runtime/tools.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/runtime/tools.h b/flang/runtime/tools.h
index ff05e76c8bb7b2..84a2a82e3b2ab8 100644
--- a/flang/runtime/tools.h
+++ b/flang/runtime/tools.h
@@ -108,7 +108,7 @@ static inline RT_API_ATTRS std::optional<std::int64_t> GetInt64Safe(
   case 16: {
     using Int128 = CppTypeFor<TypeCategory::Integer, 16>;
     auto n{*reinterpret_cast<const Int128 *>(p)};
-    std::int64_t result = n;
+    std::int64_t result = static_cast<std::int64_t>(n);
     if (result == n) {
       return result;
     }



More information about the flang-commits mailing list