aboutsummaryrefslogtreecommitdiff
path: root/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp')
-rw-r--r--test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp b/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
index 5a8f7a28a042..e1612ae05421 100644
--- a/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
@@ -10,7 +10,9 @@
#include <memory>
#include <cassert>
-#if __cplusplus >= 201103L
+#include "test_macros.h"
+
+#if TEST_STD_VER >= 11
// #include <memory>
//
// template <class Alloc>
@@ -19,7 +21,7 @@
// typedef Alloc allocator_type;
// typedef typename allocator_type::value_type
// value_type;
-//
+//
// typedef Alloc::pointer | value_type* pointer;
// typedef Alloc::const_pointer
// | pointer_traits<pointer>::rebind<const value_type>
@@ -36,7 +38,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 +75,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, "");
@@ -105,11 +113,11 @@ int main()
{
test_pointer<std::allocator<char>> ();
test_pointer<std::allocator<int>> ();
- test_pointer<std::allocator<Foo>> ();
+ test_pointer<std::allocator<Foo>> ();
test_void_pointer<std::allocator<char>> ();
test_void_pointer<std::allocator<int>> ();
- test_void_pointer<std::allocator<Foo>> ();
+ test_void_pointer<std::allocator<Foo>> ();
}
#else
int main() {}