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/pairs.pair
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
..
U_V.pass.cpp Refactor test archetypes implementation. 9 years ago
assign_const_pair_U_V.pass.cpp fix typo in align_const_pair_U_V.pass.cpp 8 years ago
assign_pair.pass.cpp Recommit r276548 - Make pair/tuples assignment operators SFINAE properly. 9 years ago
assign_pair_cxx03.pass.cpp Remove all usages of REQUIRES-ANY in the test suite. 9 years ago
assign_rv_pair.pass.cpp [libcxx] [test] Avoid MSVC truncation warnings. 8 years ago
assign_rv_pair_U_V.pass.cpp Move libc++ pair/tuple assign test to libcxx/ test directory. 8 years ago
const_first_const_second.pass.cpp Refactor test archetypes implementation. 9 years ago
const_first_const_second_cxx03.pass.cpp Implement the std::pair parts of "Improving pair and tuple". Completes N4387. 9 years ago
const_pair_U_V.pass.cpp [libcxx] [test] Avoid MSVC truncation warnings. 8 years ago
const_pair_U_V_cxx03.pass.cpp [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 3/7. 9 years ago
copy_ctor.pass.cpp [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 3/7. 9 years ago
default-sfinae.pass.cpp [libcxx] [test] Fix comment typos, strip trailing whitespace. 9 years ago
default.pass.cpp [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3. 9 years ago
dtor.pass.cpp [libcxx] [test] Strip trailing whitespace. NFC. 9 years ago
implicit_deduction_guides.pass.cpp Add C++17 explicit deduction guides to std::pair. 8 years ago
move_ctor.pass.cpp [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 3/7. 9 years ago
not_constexpr_cxx11.fail.cpp Implement the std::pair parts of "Improving pair and tuple". Completes N4387. 9 years ago
piecewise.pass.cpp Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library 9 years ago
rv_pair_U_V.pass.cpp [libcxx] [test] Avoid MSVC truncation warnings. 8 years ago
special_member_generation_test.pass.cpp Refactor test archetypes implementation. 9 years ago
swap.pass.cpp [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 3/7. 9 years ago
trivial_copy_move.pass.cpp Disable trivial pair copy/move tests when unsupported 9 years ago
types.pass.cpp Move test into test/std subdirectory. 11 years ago