Switch to a C-style cast here to silence a brain-dead MSVC warning. It
authorChandler Carruth <chandlerc@gmail.com>
Mon, 5 Mar 2012 09:56:12 +0000 (09:56 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 5 Mar 2012 09:56:12 +0000 (09:56 +0000)
complains about the truncation of a 64-bit constant to a 32-bit value
when size_t is 32-bits wide, but *only with static_cast*!!! The exact
signal that should *silence* such a warning, and in fact does silence it
with both GCC and Clang.

Anyways, this was causing grief for all the MSVC builds, so pointless
change made. Thanks to Nikola on IRC for confirming that this works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152021 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Hashing.h

index e4dc613652df7e0977e7bcf1bb3d073a15e3e9c2..06f4ce215ec77765fdb06e9c92a46bea21fde822 100644 (file)
@@ -338,7 +338,7 @@ inline size_t get_execution_seed() {
   // called, return that instead of the per-execution seed.
   const uint64_t seed_prime = 0xff51afd7ed558ccdULL;
   static size_t seed = fixed_seed_override ? fixed_seed_override
-                                           : static_cast<size_t>(seed_prime);
+                                           : (size_t)seed_prime;
   return seed;
 }