[flang-commits] [flang] 61a55c8 - [flang] Fix error compiling std::min on macos
Tim Keith via flang-commits
flang-commits at lists.llvm.org
Thu Mar 25 11:19:06 PDT 2021
Author: Tim Keith
Date: 2021-03-25T11:18:40-07:00
New Revision: 61a55c8812e790842799ba1de5bd81fe8afb3b16
URL: https://github.com/llvm/llvm-project/commit/61a55c8812e790842799ba1de5bd81fe8afb3b16
DIFF: https://github.com/llvm/llvm-project/commit/61a55c8812e790842799ba1de5bd81fe8afb3b16.diff
LOG: [flang] Fix error compiling std::min on macos
On macos, `size_t` is `unsigned long` while `size_t - int64_t` is
`unsigned long long` so std::min requires an explicit type to compile.
Differential Revision: https://reviews.llvm.org/D99340
Added:
Modified:
flang/unittests/Runtime/buffer.cpp
Removed:
################################################################################
diff --git a/flang/unittests/Runtime/buffer.cpp b/flang/unittests/Runtime/buffer.cpp
index 4f1c96b63350..f5eca0338939 100644
--- a/flang/unittests/Runtime/buffer.cpp
+++ b/flang/unittests/Runtime/buffer.cpp
@@ -31,7 +31,7 @@ class Store : public FileFrame<Store, tinyBuffer> {
static_cast<int>(at), static_cast<int>(minBytes),
static_cast<int>(maxBytes));
}
- auto result{std::min(maxBytes, bytes_ - at)};
+ auto result{std::min<std::size_t>(maxBytes, bytes_ - at)};
std::memcpy(to, &data_[at], result);
expect_ = at + result;
return result;
More information about the flang-commits
mailing list