[libcxx-commits] [PATCH] D60097: Fix implementation of ::abs and std::abs LWG 2192.

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 1 16:30:07 PDT 2019


mclow.lists added a comment.

I like the tests. Still looking at the code.



================
Comment at: test/std/depr/depr.c.headers/stdlib_h.pass.cpp:92
+                "");
+
+  static_assert(!has_abs<unsigned>::value, "");
----------------
same as below re: `signed char` and `size_t`


================
Comment at: test/std/language.support/support.runtime/cstdlib.pass.cpp:67
+      (std::is_same<decltype(std::abs((unsigned short)0)), int>::value), "");
+
+  assert(std::abs(-1.) == 1);
----------------
How about `signed char` here?  I don't think that there are any others we need to check.


================
Comment at: test/std/numerics/c.math/cmath.pass.cpp:137
+  static_assert(!has_abs<unsigned long long>::value, "");
+
+#ifdef __clang__
----------------
How about `size_t` here?


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D60097





More information about the libcxx-commits mailing list