[PATCH] D100320: [flang] Fix narrowing warning on macos

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 12 09:41:20 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG50386fe1db3c: [flang] Fix narrowing warning on macos (authored by tskeith).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100320/new/

https://reviews.llvm.org/D100320

Files:
  flang/runtime/random.cpp


Index: flang/runtime/random.cpp
===================================================================
--- flang/runtime/random.cpp
+++ flang/runtime/random.cpp
@@ -57,7 +57,7 @@
       Int fraction{generator()};
       if constexpr (words > 1) {
         for (std::size_t k{1}; k < words; ++k) {
-          static constexpr Int rangeMask{(Int{1} << rangeBits) - 1};
+          static constexpr auto rangeMask{(GeneratedWord{1} << rangeBits) - 1};
           GeneratedWord word{(generator() - generator.min()) & rangeMask};
           fraction = (fraction << rangeBits) | word;
         }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100320.336869.patch
Type: text/x-patch
Size: 586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210412/d552ad42/attachment.bin>


More information about the llvm-commits mailing list