unordered_map.h (unordered_map, [...]): Add missing constructors.
[gcc.git] / libstdc++-v3 / include / bits / alloc_traits.h
index 12c6c12f187b6f45bbb9ea705d550d9edbe753f4..e434261802fcf1b5f5e95616650da1b7a155f69d 100644 (file)
@@ -315,7 +315,12 @@ _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap,
               typename = _Require<__not_<__has_max_size<_Alloc2>>>>
        static size_type
        _S_max_size(_Alloc2&, ...)
-       { return __gnu_cxx::__numeric_traits<size_type>::__max; }
+       {
+         // _GLIBCXX_RESOLVE_LIB_DEFECTS
+         // 2466. allocator_traits::max_size() default behavior is incorrect
+         return __gnu_cxx::__numeric_traits<size_type>::__max
+           / sizeof(value_type);
+       }
 
       template<typename _Alloc2>
        struct __select_helper