[all-commits] [llvm/llvm-project] 4207ad: [libc++] Fix noexcept behaviour of operator new he...

azhan92 via All-commits all-commits at lists.llvm.org
Mon Jan 22 10:39:06 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4207ad57707f07208dfb1d7c79889e1372c396ab
      https://github.com/llvm/llvm-project/commit/4207ad57707f07208dfb1d7c79889e1372c396ab
  Author: azhan92 <alisonxzhang at gmail.com>
  Date:   2024-01-22 (Mon, 22 Jan 2024)

  Changed paths:
    M libcxx/src/new.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new.size.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new.size_align.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new.size_align_nothrow.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new.size_nothrow.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size_align.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size_align_nothrow.except.pass.cpp
    A libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size_nothrow.except.pass.cpp
    M libcxxabi/src/stdlib_new_delete.cpp

  Log Message:
  -----------
  [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 at ibm.com>




More information about the All-commits mailing list