[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
diff --git a/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp b/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
index ad2b14e..b56d3ef 100644
--- a/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
@@ -35,7 +35,7 @@
constexpr int foo = std::plus<int> () (3, 2);
static_assert ( foo == 5, "" );
- constexpr int bar = std::plus<> () (3.0, 2);
- static_assert ( bar == 5, "" );
+ constexpr double bar = std::plus<> () (3.0, 2);
+ static_assert ( bar == 5.0, "" );
#endif
}