diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-08 21:38:14 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-12-08 21:38:14 +0000 |
commit | 7abade37699ebd471baca54715e6e3511533ef5f (patch) | |
tree | 95d421249bf01f1a789fa846abd01e40d628c359 /libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp | |
parent | c255fa5e9325b8c5b19f7ba3e04f434f447e1d94 (diff) | |
download | bcm5719-llvm-7abade37699ebd471baca54715e6e3511533ef5f.tar.gz bcm5719-llvm-7abade37699ebd471baca54715e6e3511533ef5f.zip |
[libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 3/7.
Add static_cast<short> when constructing pair<Whatever, short> from (Something, int).
Fixes D27540.
llvm-svn: 289107
Diffstat (limited to 'libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp index 9ef7bcff2ba..c09c8815e16 100644 --- a/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const.pass.cpp @@ -24,7 +24,7 @@ int main() { { typedef std::pair<int, short> P; - const P p(3, 4); + const P p(3, static_cast<short>(4)); assert(std::get<0>(p) == 3); assert(std::get<1>(p) == 4); } @@ -32,7 +32,7 @@ int main() #if TEST_STD_VER > 11 { typedef std::pair<int, short> P; - constexpr P p1(3, 4); + constexpr P p1(3, static_cast<short>(4)); static_assert(std::get<0>(p1) == 3, ""); static_assert(std::get<1>(p1) == 4, ""); } |