tbaeder marked an inline comment as done.
tbaeder 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);
----------------
shafik wrote:
> This should work for `floating_point` as well.
We don't do floating point values yet.


================
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);
----------------
shafik wrote:
> Why the `!= 0` shouldn't these all implicitly convert to `bool` with 
> appropriate values?
Not 100% sure why this was used, it was there before so I left it in.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132739/new/

https://reviews.llvm.org/D132739

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to