[PATCH] D70200: Fix illegal cast from uint64_t to int64_t

Sajjad Mirza via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 14:45:48 PST 2019


sajjadm marked 2 inline comments as done.
sajjadm added inline comments.


================
Comment at: llvm/tools/llvm-cov/CoverageExporterJson.cpp:72
+  uint64_t int64_max = static_cast<uint64_t>(std::numeric_limits<int64_t>::max());
+  return u > int64_max ? int64_max : u;
+}
----------------
Dor1s wrote:
> nit: can return `std::min(u, std::numeric_limits<int64_t>::max())`
FYI we still needed the static_cast to make template deduction work


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70200





More information about the llvm-commits mailing list