summaryrefslogtreecommitdiff
path: root/absl/memory
diff options
context:
space:
mode:
Diffstat (limited to 'absl/memory')
-rw-r--r--absl/memory/memory.h4
-rw-r--r--absl/memory/memory_test.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/absl/memory/memory.h b/absl/memory/memory.h
index 513f7103..2b5ff623 100644
--- a/absl/memory/memory.h
+++ b/absl/memory/memory.h
@@ -420,6 +420,9 @@ struct pointer_traits<T*> {
//
// A C++11 compatible implementation of C++17's std::allocator_traits.
//
+#if __cplusplus >= 201703L
+using std::allocator_traits;
+#else // __cplusplus >= 201703L
template <typename Alloc>
struct allocator_traits {
using allocator_type = Alloc;
@@ -609,6 +612,7 @@ struct allocator_traits {
return a;
}
};
+#endif // __cplusplus >= 201703L
namespace memory_internal {
diff --git a/absl/memory/memory_test.cc b/absl/memory/memory_test.cc
index 0d2e13bd..1990c7ba 100644
--- a/absl/memory/memory_test.cc
+++ b/absl/memory/memory_test.cc
@@ -555,7 +555,7 @@ TEST(AllocatorTraits, FunctionsMinimal) {
EXPECT_CALL(mock, deallocate(&x, 7));
EXPECT_EQ(&x, Traits::allocate(mock, 7));
- Traits::allocate(mock, 7, static_cast<const void*>(&hint));
+ static_cast<void>(Traits::allocate(mock, 7, static_cast<const void*>(&hint)));
EXPECT_EQ(&x, Traits::allocate(mock, 7, static_cast<const void*>(&hint)));
Traits::deallocate(mock, &x, 7);