[libcxx-commits] [libcxxabi] [libcxxabi] Add a missing include for abort() (PR #126865)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 12 05:16:53 PST 2025


https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/126865

>From b4b77c95fcd8449236017f77f36498c2da1b9519 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Wed, 12 Feb 2025 16:10:39 +0900
Subject: [PATCH 1/2] [libcxxabi] Add a missing include for abort()

---
 libcxxabi/src/cxa_default_handlers.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp
index b029982ea87c3..c48563bd44706 100644
--- a/libcxxabi/src/cxa_default_handlers.cpp
+++ b/libcxxabi/src/cxa_default_handlers.cpp
@@ -9,6 +9,7 @@
 // new_handler.
 //===----------------------------------------------------------------------===//
 
+#include <cstdlib>
 #include <exception>
 #include <new>
 #include "abort_message.h"

>From 3e972b3d479d56bd7ffb55d9c6cab130c36150b5 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Wed, 12 Feb 2025 14:15:50 +0100
Subject: [PATCH 2/2] Use std::abort

---
 libcxxabi/src/cxa_default_handlers.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp
index c48563bd44706..97a6765fde8e9 100644
--- a/libcxxabi/src/cxa_default_handlers.cpp
+++ b/libcxxabi/src/cxa_default_handlers.cpp
@@ -9,7 +9,7 @@
 // new_handler.
 //===----------------------------------------------------------------------===//
 
-#include <cstdlib>
+#include <cstdlib> // std::abort
 #include <exception>
 #include <new>
 #include "abort_message.h"
@@ -95,7 +95,7 @@ static void demangling_unexpected_handler()
 static constexpr std::terminate_handler default_terminate_handler = demangling_terminate_handler;
 static constexpr std::terminate_handler default_unexpected_handler = demangling_unexpected_handler;
 #else // !LIBCXXABI_SILENT_TERMINATE
-static constexpr std::terminate_handler default_terminate_handler = ::abort;
+static constexpr std::terminate_handler default_terminate_handler = std::abort;
 static constexpr std::terminate_handler default_unexpected_handler = std::terminate;
 #endif // !LIBCXXABI_SILENT_TERMINATE
 



More information about the libcxx-commits mailing list