[libcxx-commits] [PATCH] D157446: [libc++] Use _LIBCPP_VERBOSE_ABORT from __throw_bad_alloc

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 8 15:11:26 PDT 2023


ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

It seems like this one was forgotten and we were still using a raw
std::abort().


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157446

Files:
  libcxx/src/new_helpers.cpp


Index: libcxx/src/new_helpers.cpp
===================================================================
--- libcxx/src/new_helpers.cpp
+++ libcxx/src/new_helpers.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <cstdlib>
+#include <__verbose_abort>
 #include <new>
 
 namespace std { // purposefully not versioned
@@ -21,7 +21,7 @@
 #  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
   throw bad_alloc();
 #  else
-  std::abort();
+  _LIBCPP_VERBOSE_ABORT("bad_alloc was thrown in -fno-exceptions mode");
 #  endif
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157446.548372.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230808/31bc8732/attachment.bin>


More information about the libcxx-commits mailing list