From 5fc69134a15a436e69c5b1db26f0a91c1deb3acb Mon Sep 17 00:00:00 2001 From: kkwli Date: Mon, 6 Nov 2023 11:02:19 -0500 Subject: [PATCH] [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. --- flang/lib/Evaluate/fold-implementation.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flang/lib/Evaluate/fold-implementation.h b/flang/lib/Evaluate/fold-implementation.h index 868b7b6990fd38..a1bde778e5ec07 100644 --- a/flang/lib/Evaluate/fold-implementation.h +++ b/flang/lib/Evaluate/fold-implementation.h @@ -910,7 +910,8 @@ template Expr Folder::RESHAPE(FunctionRef &&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(source->size()), resultElements), + subscripts, dimOrderPtr)}; if (copied < resultElements) { CHECK(pad); copied += result.CopyFrom(