Skip to content

Commit 5fc6913

Browse files
authored
[flang] Match argument types for std::min (#71102)
PR #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.
1 parent 8f76522 commit 5fc6913

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Evaluate/fold-implementation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,8 @@ template <typename T> Expr<T> Folder<T>::RESHAPE(FunctionRef<T> &&funcRef) {
910910
: pad->Reshape(std::move(shape.value()))};
911911
ConstantSubscripts subscripts{result.lbounds()};
912912
auto copied{result.CopyFrom(*source,
913-
std::min(source->size(), resultElements), subscripts, dimOrderPtr)};
913+
std::min(static_cast<uint64_t>(source->size()), resultElements),
914+
subscripts, dimOrderPtr)};
914915
if (copied < resultElements) {
915916
CHECK(pad);
916917
copied += result.CopyFrom(

0 commit comments

Comments
 (0)