Skip to content

Commit

Permalink
[flang] Match argument types for std::min (llvm#71102)
Browse files Browse the repository at this point in the history
PR llvm#68342 causes build breakage on MacOS due to uint64_t being defined
as unsigned long long instead of unsigned long. It leads to type
mismatch in the arguments for std::min.
  • Loading branch information
kkwli committed Nov 6, 2023
1 parent 8f76522 commit 5fc6913
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flang/lib/Evaluate/fold-implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,8 @@ template <typename T> Expr<T> Folder<T>::RESHAPE(FunctionRef<T> &&funcRef) {
: pad->Reshape(std::move(shape.value()))};
ConstantSubscripts subscripts{result.lbounds()};
auto copied{result.CopyFrom(*source,
std::min(source->size(), resultElements), subscripts, dimOrderPtr)};
std::min(static_cast<uint64_t>(source->size()), resultElements),
subscripts, dimOrderPtr)};
if (copied < resultElements) {
CHECK(pad);
copied += result.CopyFrom(
Expand Down

0 comments on commit 5fc6913

Please sign in to comment.