From f47536798d2a69901035e3a9fd23f7240e25ff27 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 24 Dec 2016 01:29:27 +0000 Subject: [PATCH] Fix yet another missed -Wunused warning. Hopefully this is the last one git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290476 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../forwardlist/forwardlist.cons/size.pass.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp index db40707a2..b536ccf49 100644 --- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp +++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp @@ -28,6 +28,9 @@ void check_allocator(unsigned n, Allocator const &alloc = Allocator()) C d(n, alloc); assert(d.get_allocator() == alloc); assert(static_cast(std::distance(d.begin(), d.end())) == n); +#else + ((void)n); + ((void)alloc); #endif } @@ -39,12 +42,14 @@ int main() unsigned N = 10; C c(N); unsigned n = 0; - for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + + for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) { +#if TEST_STD_VER >= 11 assert(*i == T()); #else - ; + ((void)0); #endif + } assert(n == N); } #if TEST_STD_VER >= 11 @@ -55,11 +60,7 @@ int main() C c(N); unsigned n = 0; for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n) -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES assert(*i == T()); -#else - ; -#endif assert(n == N); check_allocator> ( 0 ); check_allocator> ( 3 );