From 412e9dbc600d6bd43b9d78e9aff436fbf3a11c06 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 3 Mar 2017 02:02:07 +0000 Subject: [PATCH] Fix sign-compare warning in test; Oddly this only appears on OS X llvm-svn: 296851 --- .../forwardlist/forwardlist.cons/move_alloc.pass.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp index 6a1afe1334b0..5f5f5d0aef60 100644 --- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // forward_list(forward_list&& x, const allocator_type& a); @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef MoveOnly T; typedef test_allocator A; @@ -33,7 +34,7 @@ int main() unsigned n = 0; for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) assert(*i == n); - assert(n == std::end(t) - std::begin(t)); + assert(n == static_cast(std::end(t) - std::begin(t))); assert(c0.empty()); assert(c.get_allocator() == A(10)); } @@ -48,11 +49,10 @@ int main() unsigned n = 0; for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) assert(*i == n); - assert(n == std::end(t) - std::begin(t)); + assert(n == static_cast(std::end(t) - std::begin(t))); assert(!c0.empty()); assert(c.get_allocator() == A(9)); } -#if TEST_STD_VER >= 11 { typedef MoveOnly T; typedef min_allocator A; @@ -64,10 +64,8 @@ int main() unsigned n = 0; for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) assert(*i == n); - assert(n == std::end(t) - std::begin(t)); + assert(n == static_cast(std::end(t) - std::begin(t))); assert(c0.empty()); assert(c.get_allocator() == A()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES }