summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/utilities')
-rw-r--r--libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp10
-rw-r--r--libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp10
-rw-r--r--libcxx/test/std/utilities/time/date.time/ctime.pass.cpp6
-rw-r--r--libcxx/test/std/utilities/utility/forward/forward.pass.cpp3
4 files changed, 24 insertions, 5 deletions
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
index e165d9836db..bc5de61d801 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
@@ -37,7 +37,10 @@ void test_pointer()
{
typename std::allocator_traits<Alloc>::pointer vp;
typename std::allocator_traits<Alloc>::const_pointer cvp;
-
+
+ ((void)vp); // Prevent unused warning
+ ((void)cvp); // Prevent unused warning
+
static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
@@ -71,7 +74,10 @@ void test_void_pointer()
{
typename std::allocator_traits<Alloc>::void_pointer vp;
typename std::allocator_traits<Alloc>::const_void_pointer cvp;
-
+
+ ((void)vp); // Prevent unused warning
+ ((void)cvp); // Prevent unused warning
+
static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
index 5a8f7a28a04..588227f0a49 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
@@ -36,7 +36,10 @@ void test_pointer()
{
typename std::allocator_traits<Alloc>::pointer vp;
typename std::allocator_traits<Alloc>::const_pointer cvp;
-
+
+ ((void)vp); // Prevent unused warning
+ ((void)cvp); // Prevent unused warning
+
static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
@@ -70,7 +73,10 @@ void test_void_pointer()
{
typename std::allocator_traits<Alloc>::void_pointer vp;
typename std::allocator_traits<Alloc>::const_void_pointer cvp;
-
+
+ ((void)vp); // Prevent unused warning
+ ((void)cvp); // Prevent unused warning
+
static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
diff --git a/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp b/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
index d0a838e0c27..b762d273de9 100644
--- a/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
+++ b/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
@@ -21,11 +21,15 @@
int main()
{
std::clock_t c = 0;
- ((void)c); // avoid unused warning
std::size_t s = 0;
std::time_t t = 0;
std::tm tm = {0};
char str[3];
+ ((void)c); // Prevent unused warning
+ ((void)s); // Prevent unused warning
+ ((void)t); // Prevent unused warning
+ ((void)tm); // Prevent unused warning
+ ((void)str); // Prevent unused warning
static_assert((std::is_same<decltype(std::clock()), std::clock_t>::value), "");
static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
diff --git a/libcxx/test/std/utilities/utility/forward/forward.pass.cpp b/libcxx/test/std/utilities/utility/forward/forward.pass.cpp
index 357b36fafa9..94575485df0 100644
--- a/libcxx/test/std/utilities/utility/forward/forward.pass.cpp
+++ b/libcxx/test/std/utilities/utility/forward/forward.pass.cpp
@@ -39,6 +39,9 @@ int main()
A a;
const A ca = A();
+ ((void)a); // Prevent unused warning
+ ((void)ca); // Prevent unused warning
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
static_assert(sizeof(test(std::forward<A&>(a))) == 1, "");
static_assert(sizeof(test(std::forward<A>(a))) == 4, "");
OpenPOWER on IntegriCloud