You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/utilities/utility/pairs
Stephan T. Lavavej f18ee8f765 [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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329973 91177308-0d34-0410-b5e6-96231b3b80d8
8 years ago
..
pair.astuple Remove unneeded typename from test 8 years ago
pair.piecewise Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library 9 years ago
pairs.general Move test into test/std subdirectory. 11 years ago
pairs.pair [libcxx] [test] Avoid MSVC truncation warnings. 8 years ago
pairs.spec [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 7/7. 9 years ago
nothing_to_do.pass.cpp Move test into test/std subdirectory. 11 years ago