llvm-project/libcxx/test/std/utilities/utility/pairs
Stephan T. Lavavej 0f66190aef [libcxx] [test] Avoid MSVC truncation warnings.
MSVC emits "warning C4244: 'initializing': conversion from 'int'
to 'short', possible loss of data" when it sees pair<Whatever, short>
constructed from (whatever, 4), because int is being truncated to
short within pair's constructor. (The compiler doesn't take into
account the fact that 4 is a literal at the callsite; it generates
this warning when the constructor is instantiated, because it might
be called with a runtime-valued int that would actually truncate.)

Instead of static_cast<short>, we can simply change short to int
in these tests, without affecting the pair operations that they're
trying to test: move assignment, convert copy construction, and
convert move construction.

Fixes D45016.

llvm-svn: 329973
2018-04-12 23:56:07 +00:00
..
pair.astuple Remove unneeded typename from test 2017-10-10 07:42:19 +00:00
pair.piecewise Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library 2017-04-19 00:56:32 +00:00
pairs.general
pairs.pair [libcxx] [test] Avoid MSVC truncation warnings. 2018-04-12 23:56:07 +00:00
pairs.spec [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 7/7. 2016-12-08 21:38:57 +00:00
nothing_to_do.pass.cpp