summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
diff options
context:
space:
mode:
authorStephan T. Lavavej <stl@exchange.microsoft.com>2016-12-08 21:38:01 +0000
committerStephan T. Lavavej <stl@exchange.microsoft.com>2016-12-08 21:38:01 +0000
commitc255fa5e9325b8c5b19f7ba3e04f434f447e1d94 (patch)
tree261660cc100525c62ea394b153971160a96adcc3 /libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
parentd7dc18e26dd7890ede5690d31a5b608ae43ea1ce (diff)
downloadbcm5719-llvm-c255fa5e9325b8c5b19f7ba3e04f434f447e1d94.tar.gz
bcm5719-llvm-c255fa5e9325b8c5b19f7ba3e04f434f447e1d94.zip
[libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 2/7.
These tests for some guy's transparent operator functors were needlessly truncating their double results to int. Preserving the doubleness makes compilers happier. I'm following existing practice by adding an "// exact in binary" comment when the result isn't a whole number. (The changes from 6 to 6.0 and so forth are stylistic, not critical.) Fixes D27539. llvm-svn: 289106
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp')
-rw-r--r--libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
index 95a688f0cb4..198894023cd 100644
--- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
@@ -34,7 +34,7 @@ int main()
constexpr int foo = std::negate<int> () (3);
static_assert ( foo == -3, "" );
- constexpr int bar = std::negate<> () (3.0);
- static_assert ( bar == -3, "" );
+ constexpr double bar = std::negate<> () (3.0);
+ static_assert ( bar == -3.0, "" );
#endif
}
OpenPOWER on IntegriCloud