From 7582e3938bb9fb3e4664efdfb2313df29f27b70b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 16 May 2017 19:47:31 +0000 Subject: Vendor import of libc++ trunk r303197: https://llvm.org/svn/llvm-project/libcxx/trunk@303197 --- .../basic.string/string.cons/T_size_size.pass.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'test/std/strings/basic.string/string.cons/T_size_size.pass.cpp') diff --git a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp index c8d14a1d0ddf..67ac43494a6e 100644 --- a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp +++ b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp @@ -27,16 +27,17 @@ template void -test(SV sv, unsigned pos, unsigned n) +test(SV sv, std::size_t pos, std::size_t n) { typedef typename S::traits_type T; typedef typename S::allocator_type A; + typedef typename S::size_type Size; if (pos <= sv.size()) { - S s2(sv, pos, n); + S s2(sv, static_cast(pos), static_cast(n)); LIBCPP_ASSERT(s2.__invariants()); assert(pos <= sv.size()); - unsigned rlen = std::min(sv.size() - pos, n); + std::size_t rlen = std::min(sv.size() - pos, n); assert(s2.size() == rlen); assert(T::compare(s2.data(), sv.data() + pos, rlen) == 0); assert(s2.get_allocator() == A()); @@ -47,7 +48,7 @@ test(SV sv, unsigned pos, unsigned n) { try { - S s2(sv, pos, n); + S s2(sv, static_cast(pos), static_cast(n)); assert(false); } catch (std::out_of_range&) @@ -60,15 +61,16 @@ test(SV sv, unsigned pos, unsigned n) template void -test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a) +test(SV sv, std::size_t pos, std::size_t n, const typename S::allocator_type& a) { typedef typename S::traits_type T; + typedef typename S::size_type Size; if (pos <= sv.size()) { - S s2(sv, pos, n, a); + S s2(sv, static_cast(pos), static_cast(n), a); LIBCPP_ASSERT(s2.__invariants()); assert(pos <= sv.size()); - unsigned rlen = std::min(sv.size() - pos, n); + std::size_t rlen = std::min(sv.size() - pos, n); assert(s2.size() == rlen); assert(T::compare(s2.data(), sv.data() + pos, rlen) == 0); assert(s2.get_allocator() == a); @@ -79,7 +81,7 @@ test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a) { try { - S s2(sv, pos, n, a); + S s2(sv, static_cast(pos), static_cast(n), a); assert(false); } catch (std::out_of_range&) -- cgit v1.3