diff options
author | Casey Carter <Casey@Carter.net> | 2019-10-09 22:19:17 +0000 |
---|---|---|
committer | Casey Carter <Casey@Carter.net> | 2019-10-09 22:19:17 +0000 |
commit | b2e3c83b0d64a7ac5c3da5829b4cc0374674f5d1 (patch) | |
tree | 14feb9735f789ddcde0f0846d088b503e5263bd3 /libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp | |
parent | dc9276b7d72342b4ddd8fff04ec8933dcdf375d4 (diff) | |
download | bcm5719-llvm-b2e3c83b0d64a7ac5c3da5829b4cc0374674f5d1.tar.gz bcm5719-llvm-b2e3c83b0d64a7ac5c3da5829b4cc0374674f5d1.zip |
[libc++][test] Miscellaneous MSVC cleanups
* Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++.
* Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`.
* Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined.
* Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings.
* Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating.
Differential Revision: https://reviews.llvm.org/D68681
llvm-svn: 374248
Diffstat (limited to 'libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp')
-rw-r--r-- | libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp index aeb9a192ca3..2c5d2408e2b 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp @@ -41,7 +41,7 @@ void fp_test() constexpr T maxV = std::numeric_limits<T>::max(); constexpr T minV = std::numeric_limits<T>::min(); - + // Things that can be compared exactly static_assert((std::midpoint(T(0), T(0)) == T(0)), ""); static_assert((std::midpoint(T(2), T(4)) == T(3)), ""); @@ -58,7 +58,7 @@ void fp_test() assert((fptest_close_pct(std::midpoint(T(0.1), T(0.4)), T(0.25), pct))); assert((fptest_close_pct(std::midpoint(T(11.2345), T(14.5432)), T(12.88885), pct))); - + // From e to pi assert((fptest_close_pct(std::midpoint(T(2.71828182845904523536028747135266249775724709369995), T(3.14159265358979323846264338327950288419716939937510)), @@ -86,7 +86,7 @@ void fp_test() // TODO // Check two values "close to each other" - T d1 = 3.14; + T d1 = T(3.14); T d0 = std::nextafter(d1, T(2)); T d2 = std::nextafter(d1, T(5)); assert(d0 < d1); // sanity checking |