llvm-project/libcxx/test/std/experimental
Mikhail Maltsev be10b1f1cc [libcxx] Make allocator<T>:allocate throw bad_array_new_length
Currently the member functions std::allocator<T>::allocate,
std::experimental::pmr::polymorphic_allocator::allocate and
std::resource_adaptor<T>::do_allocate throw an exception of type
std::length_error when the requested size exceeds the maximum size.

According to the C++ standard ([allocator.members]/4,
[mem.poly.allocator.mem]/1), std::allocator<T>::allocate and
std::pmr::polymorphic_allocator::allocate must throw a
std::bad_array_new_length exception in this case.

The patch fixes the issue with std::allocator<T>::allocate and changes
the type the exception thrown by
std::experimental::pmr::resource_adaptor<T>::do_allocate to
std::bad_array_new_length as well for consistency.

The patch resolves LWG 3237, LWG 3038 and LWG 3190.

Reviewed By: ldionne, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D110846
2021-10-18 19:12:42 +01:00
..
algorithms/alg.search [libc++] Remove the c++98 Lit feature from the test suite 2020-06-03 09:37:22 -04:00
filesystem [libc++] Make LIBCXX_ENABLE_FILESYSTEM fully consistent 2021-01-19 14:15:48 -05:00
func [libc++] Remove the c++98 Lit feature from the test suite 2020-06-03 09:37:22 -04:00
iterator/ostream.joiner [libc++] Add an option to disable wide character support in libc++ 2021-10-12 06:08:23 -04:00
language.support/support.coroutines [libc++] Remove "// -*- C++ -*-" comments from all .cpp files. NFCI. 2021-10-01 12:06:59 -04:00
memory [libcxx] Make allocator<T>:allocate throw bad_array_new_length 2021-10-18 19:12:42 +01:00
simd [libc++] [libc++abi] Mark a few tests as unsupported/xfail on gcc-7/8/9. 2020-11-26 08:59:52 +01:00
utilities [libc++] Remove the c++98 Lit feature from the test suite 2020-06-03 09:37:22 -04:00
lit.local.cfg