[libc-commits] [PATCH] D149594: [libc] Add explicit constructor calls to fix compilation when using UInt<T>
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Jun 6 10:32:10 PDT 2023
lntue added inline comments.
================
Comment at: libc/src/__support/FPUtil/x86_64/LongDoubleBits.h:128
+ if (is_zero())
+ return 0.0L;
+ UIntType bits_with_explicit_bit{bits};
----------------
`is_zero()` is also true for `-0.0L`. You'll need to check for sign:
```
return get_sign() ? -0.0L : 0.0L;
```
================
Comment at: libc/src/__support/UInt.h:480
+ constexpr UInt<Bits> operator/=(const UInt<Bits> &other) {
+ *this = *this / other;
----------------
mikhail.ramalho wrote:
> lntue wrote:
> > Should the return type be `UInt<Bits>&`?
> I followed how it's done for the other operators, do you want me to change just this one?
Please fix other `op=` signature to return references if you see them. Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149594/new/
https://reviews.llvm.org/D149594
More information about the libc-commits
mailing list