diff --git a/google/cloud/storage/internal/invocation_id_generator.cc b/google/cloud/storage/internal/invocation_id_generator.cc index f7838c8adca3c..7534fd470a4e1 100644 --- a/google/cloud/storage/internal/invocation_id_generator.cc +++ b/google/cloud/storage/internal/invocation_id_generator.cc @@ -42,10 +42,11 @@ std::string InvocationIdGenerator::MakeInvocationId() { auto constexpr kIdBitCount = 128; auto constexpr kArraySize = kIdBitCount / 8; std::array buf; - std::uniform_int_distribution d(0, 255); + std::uniform_int_distribution d(0, 255); std::lock_guard lk(mu_); - std::generate(buf.begin(), buf.end(), [&] { return d(generator_); }); + std::generate(buf.begin(), buf.end(), + [&] { return static_cast(d(generator_)); }); return buf; }(); o[kVersionOctet] = (o[kVersionOctet] & kVersionMask) | kVersion;