Skip to content

Commit c045763

Browse files
committed
Add missing depromote to shift_left_into.
1 parent 85a6aca commit c045763

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • include/bitcoin/system/impl/math

include/bitcoin/system/impl/math/bits.ipp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ template <typename Value, if_unsigned_integral_integer<Value>>
294294
constexpr void shift_left_into(Value& value, size_t shift, bool overflow) NOEXCEPT
295295
{
296296
constexpr auto span = bits<Value>;
297-
overflow && shift >= span ? value = 0 :
298-
value <<= (shift % span);
297+
overflow && shift >= span ? value = 0 : depromote<Value>(
298+
value <<= (shift % span));
299299
}
300300

301301
// signed overloads (shift left of negative is undefined behavior).

0 commit comments

Comments
 (0)