Skip to content

Commit 6f959a4

Browse files
committed
[lldb] uint8_t -> unsigned short in std::independent_bits_engine
According to [1], the template parameter must be cv-unqualified and one of unsigned short, unsigned int, unsigned long, or unsigned long long. Should fix the following MSVC error: error: static assertion failed due to requirement '_Is_any_of_v<unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>': invalid template argument for independent_bits_engine: N4659 [1] https://en.cppreference.com/w/cpp/numeric/random/independent_bits_engine
1 parent 00122bb commit 6f959a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lldb/source/Utility/UUID.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ UUID UUID::Generate(uint32_t num_bytes) {
123123
// If getRandomBytes failed, fall back to a lower entropy source.
124124
if (ec) {
125125
auto seed = std::chrono::steady_clock::now().time_since_epoch().count();
126-
std::independent_bits_engine<std::default_random_engine, CHAR_BIT, uint8_t>
126+
std::independent_bits_engine<std::default_random_engine, CHAR_BIT,
127+
unsigned short>
127128
engine(seed);
128129
std::generate(bytes.begin(), bytes.end(), std::ref(engine));
129130
}

0 commit comments

Comments
 (0)