[libc++] Fix noexcept behaviour of operator new helper functions  (#74337)

This patch removes the noexcept specifier introduced in #69407 since the
Standard allows a new handler to throw an exception of type bad_alloc
(or derived from it). With the noexcept specifier on the helper
functions, we would immediately terminate the program.

The patch also adds tests for the case that had regressed.

Co-authored-by: Alison Zhang <alisonzhang@ibm.com>
GitOrigin-RevId: 4207ad57707f07208dfb1d7c79889e1372c396ab
1 file changed