[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:42 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-runtime

Author: long.chen (lipracer)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/76491.diff


1 Files Affected:

- (modified) flang/runtime/tools.h (+1-1) 


``````````diff
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;
     }

``````````

</details>


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


More information about the flang-commits mailing list