[libc-commits] [libc] 80bba17 - [libc][FPUtil] fixup missing explicit cast (#86736)

via libc-commits libc-commits at lists.llvm.org
Tue Mar 26 14:53:08 PDT 2024


Author: Nick Desaulniers
Date: 2024-03-26T14:53:04-07:00
New Revision: 80bba17914dec52789d2e75ed560acb11cce959a

URL: https://github.com/llvm/llvm-project/commit/80bba17914dec52789d2e75ed560acb11cce959a
DIFF: https://github.com/llvm/llvm-project/commit/80bba17914dec52789d2e75ed560acb11cce959a.diff

LOG: [libc][FPUtil] fixup missing explicit cast (#86736)

The arm32 buildbot reports an error because UInt::operator bool() is explicit,
thus an explicit cast is necessary.

Link: #85940

Added: 
    

Modified: 
    libc/src/__support/FPUtil/BasicOperations.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/FPUtil/BasicOperations.h b/libc/src/__support/FPUtil/BasicOperations.h
index 405755f8b57d9b..f746d7ac6ad41f 100644
--- a/libc/src/__support/FPUtil/BasicOperations.h
+++ b/libc/src/__support/FPUtil/BasicOperations.h
@@ -199,7 +199,7 @@ LIBC_INLINE int canonicalize(T &cx, const T &x) {
     //  Values    |            |           | (−1)**s × m × 2**−16382
     bool bit63 = sx.get_implicit_bit();
     UInt128 mantissa = sx.get_explicit_mantissa();
-    bool bit62 = ((mantissa & (1ULL << 62)) >> 62);
+    bool bit62 = static_cast<bool>((mantissa & (1ULL << 62)) >> 62);
     int exponent = sx.get_biased_exponent();
     if (exponent == 0x7FFF) {
       if (!bit63 && !bit62) {


        


More information about the libc-commits mailing list