From a5847bcb732d5888170d11e4c302e6ddd7b36934 Mon Sep 17 00:00:00 2001 From: Michael Flanders Date: Sun, 10 Mar 2024 18:05:46 +0000 Subject: [PATCH] [libc][stdbit] fix truncation err in CPP bit_ceil --- libc/src/__support/CPP/bit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/src/__support/CPP/bit.h b/libc/src/__support/CPP/bit.h index 4464703e4b064..1a05728b85065 100644 --- a/libc/src/__support/CPP/bit.h +++ b/libc/src/__support/CPP/bit.h @@ -193,7 +193,7 @@ template bit_ceil(T value) { if (value < 2) return 1; - return static_cast(T(1) << cpp::bit_width(value - 1u)); + return static_cast(T(1) << cpp::bit_width(value - 1U)); } // Rotate algorithms make use of "Safe, Efficient, and Portable Rotate in C/C++"