Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
9 changed files
with
33 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters