diff --git a/include/memory b/include/memory index 97ad4403..04d57d5d 100644 --- a/include/memory +++ b/include/memory @@ -1678,7 +1678,7 @@ private: {return __a.max_size();} _LIBCPP_INLINE_VISIBILITY static size_type __max_size(false_type, const allocator_type&) - {return numeric_limits::max();} + {return numeric_limits::max() / sizeof(value_type);} _LIBCPP_INLINE_VISIBILITY static allocator_type diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp index 1fa72912..352c7c8d 100644 --- a/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp +++ b/test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp @@ -45,12 +45,12 @@ int main() { A a; assert(std::allocator_traits >::max_size(a) == - std::numeric_limits::max()); + std::numeric_limits::max() / sizeof(int)); } { const A a = {}; assert(std::allocator_traits >::max_size(a) == - std::numeric_limits::max()); + std::numeric_limits::max() / sizeof(int)); } #endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE { diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index 1df7401e..5f582f1c 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -172,7 +172,7 @@ 2435reference_wrapper::operator()'s Remark should be deletedKonaComplete 2447Allocators and volatile-qualified value typesKonaComplete 2462std::ios_base::failure is overspecifiedKonaComplete - 2466allocator_traits::max_size() default behavior is incorrectKonaPatch Ready + 2466allocator_traits::max_size() default behavior is incorrectKonaComplete 2469Wrong specification of Requires clause of operator[] for map and unordered_mapKona 2473basic_filebuf's relation to C FILE semanticsKonaComplete 2476scoped_allocator_adaptor is not assignableKonaPatch Ready @@ -184,7 +184,6 @@ 2487bind() should be const-overloaded, not cv-overloadedKonaComplete 2489mem_fn() should be noexceptKonaPatch Ready 2492Clarify requirements for compKonaComplete - 2494[fund.ts.v2] ostream_joiner needs noexceptKona 2495There is no such thing as an Exception Safety elementKona