Add a test for LWG#2466: allocator_traits::max_size() default behavior is incorrect
llvm-svn: 251252
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: b631c24359c8299d570786abc6fe81920d97c67b
diff --git a/include/memory b/include/memory
index 97ad440..04d57d5 100644
--- a/include/memory
+++ b/include/memory
@@ -1678,7 +1678,7 @@
{return __a.max_size();}
_LIBCPP_INLINE_VISIBILITY
static size_type __max_size(false_type, const allocator_type&)
- {return numeric_limits<size_type>::max();}
+ {return numeric_limits<size_type>::max() / sizeof(value_type);}
_LIBCPP_INLINE_VISIBILITY
static allocator_type