[libcxx-commits] [libcxx] 7e3ef29 - [libc++][test] Use a non-narrowing conversion in assign_pair.pass.cpp
Casey Carter via libcxx-commits
libcxx-commits at lists.llvm.org
Sun May 3 11:00:13 PDT 2020
Author: Casey Carter
Date: 2020-05-03T10:59:10-07:00
New Revision: 7e3ef299cb3fa9a1cbca316740c12029af62922c
URL: https://github.com/llvm/llvm-project/commit/7e3ef299cb3fa9a1cbca316740c12029af62922c
DIFF: https://github.com/llvm/llvm-project/commit/7e3ef299cb3fa9a1cbca316740c12029af62922c.diff
LOG: [libc++][test] Use a non-narrowing conversion in assign_pair.pass.cpp
...to avoid warnings, e.g., from MSVC.
Added:
Modified:
libcxx/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp
index 55ce0fced101..27a1cdb76e28 100644
--- a/libcxx/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp
+++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp
@@ -54,8 +54,8 @@ extern Incomplete inc_obj;
int main(int, char**)
{
{
- typedef std::pair<CopyAssignable, short> P;
- const P p1(CopyAssignable(), 4);
+ typedef std::pair<CopyAssignable, int> P;
+ const P p1(CopyAssignable(), short{4});
P p2;
p2 = p1;
assert(p2.second == 4);
@@ -97,7 +97,7 @@ int main(int, char**)
assert(&p.second == &inc_obj);
}
- return 0;
+ return 0;
}
struct Incomplete {};
More information about the libcxx-commits
mailing list