[libcxx] r290476 - Fix yet another missed -Wunused warning. Hopefully this is the last one
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 23 17:29:28 PST 2016
Author: ericwf
Date: Fri Dec 23 19:29:27 2016
New Revision: 290476
URL: http://llvm.org/viewvc/llvm-project?rev=290476&view=rev
Log:
Fix yet another missed -Wunused warning. Hopefully this is the last one
Modified:
libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
Modified: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp?rev=290476&r1=290475&r2=290476&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp Fri Dec 23 19:29:27 2016
@@ -28,6 +28,9 @@ void check_allocator(unsigned n, Allocat
C d(n, alloc);
assert(d.get_allocator() == alloc);
assert(static_cast<std::size_t>(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<T, min_allocator<T>> ( 0 );
check_allocator<T, min_allocator<T>> ( 3 );
More information about the cfe-commits
mailing list