[flang-commits] [flang] [flang] Match argument types for std::min (PR #71102)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Mon Nov 6 06:08:39 PST 2023


================
@@ -910,7 +910,9 @@ 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<decltype(resultElements)>(source->size()),
----------------
luporl wrote:

I would opt for  `static_cast<uint64_t>(source->size())` instead, since `resultElements` was declared with an explicit type right above, but it's a matter of preference.

https://github.com/llvm/llvm-project/pull/71102


More information about the flang-commits mailing list