[libcxx] r296851 - Fix sign-compare warning in test; Oddly this only appears on OS X
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 2 18:02:07 PST 2017
Author: ericwf
Date: Thu Mar 2 20:02:07 2017
New Revision: 296851
URL: http://llvm.org/viewvc/llvm-project?rev=296851&view=rev
Log:
Fix sign-compare warning in test; Oddly this only appears on OS X
Modified:
libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
Modified: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp?rev=296851&r1=296850&r2=296851&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp Thu Mar 2 20:02:07 2017
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// 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<T> 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<unsigned>(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<unsigned>(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<T> 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<unsigned>(std::end(t) - std::begin(t)));
assert(c0.empty());
assert(c.get_allocator() == A());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
More information about the cfe-commits
mailing list