shafik added inline comments.
================
Comment at: clang/lib/AST/Interp/Boolean.h:90
+ template <typename T> static Boolean from(T Value) {
+ if constexpr (std::is_integral<T>::value)
+ return Boolean(Value != 0);
----------------
This should work for `floating_point` as well.
================
Comment at: clang/lib/AST/Interp/Boolean.h:91
+ if constexpr (std::is_integral<T>::value)
+ return Boolean(Value != 0);
+ return Boolean(static_cast<decltype(Boolean::V)>(Value) != 0);
----------------
Why the `!= 0` shouldn't these all implicitly convert to `bool` with
appropriate values?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132739/new/
https://reviews.llvm.org/D132739
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits