Add a test for LWG#2466: allocator_traits::max_size() default behavior is incorrect

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@251252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-10-25 19:34:04 +00:00
parent 175cb20bfb
commit 88fa03a06e
3 changed files with 4 additions and 5 deletions

View File

@@ -45,12 +45,12 @@ int main()
{
A<int> a;
assert(std::allocator_traits<A<int> >::max_size(a) ==
std::numeric_limits<std::size_t>::max());
std::numeric_limits<std::size_t>::max() / sizeof(int));
}
{
const A<int> a = {};
assert(std::allocator_traits<A<int> >::max_size(a) ==
std::numeric_limits<std::size_t>::max());
std::numeric_limits<std::size_t>::max() / sizeof(int));
}
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
{