Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] fix compiler report error on windows #76491

Closed
wants to merge 1 commit into from

Conversation

lipracer
Copy link
Member

No description provided.

@llvmbot llvmbot added flang:runtime flang Flang issues not falling into any other category labels Dec 28, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 28, 2023

@llvm/pr-subscribers-flang-runtime

Author: long.chen (lipracer)

Changes

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

1 Files Affected:

  • (modified) flang/runtime/tools.h (+1-1)
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;
     }

@lipracer lipracer closed this Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:runtime flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants