Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc][FPUtil] fixup missing explicit cast #86736

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

nickdesaulniers
Copy link
Member

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

Link: #85940

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

Link: llvm#85940
@nickdesaulniers
Copy link
Member Author

cc @Sh0g0-1758

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 26, 2024

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Changes

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

Link: #85940


Full diff: https://github.com/llvm/llvm-project/pull/86736.diff

1 Files Affected:

  • (modified) libc/src/__support/FPUtil/BasicOperations.h (+1-1)
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) {

@nickdesaulniers nickdesaulniers merged commit 80bba17 into llvm:main Mar 26, 2024
6 checks passed
@nickdesaulniers nickdesaulniers deleted the arm32_fix branch March 26, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants