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

via flang-commits flang-commits at lists.llvm.org
Mon Nov 6 08:02:23 PST 2023


Author: kkwli
Date: 2023-11-06T11:02:19-05:00
New Revision: 5fc69134a15a436e69c5b1db26f0a91c1deb3acb

URL: https://github.com/llvm/llvm-project/commit/5fc69134a15a436e69c5b1db26f0a91c1deb3acb
DIFF: https://github.com/llvm/llvm-project/commit/5fc69134a15a436e69c5b1db26f0a91c1deb3acb.diff

LOG: [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.

Added: 
    

Modified: 
    flang/lib/Evaluate/fold-implementation.h

Removed: 
    


################################################################################
diff  --git a/flang/lib/Evaluate/fold-implementation.h b/flang/lib/Evaluate/fold-implementation.h
index 868b7b6990fd384..a1bde778e5ec07e 100644
--- a/flang/lib/Evaluate/fold-implementation.h
+++ b/flang/lib/Evaluate/fold-implementation.h
@@ -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(


        


More information about the flang-commits mailing list