authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-03 12:20:01+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-31 23:09:46+02:00
loga072d6021653db952bffd93e7c8704ead9ac106d
treeecf60931a2ab0cf74ff6d0e1259236f96d22f390
parent9f88510f6f3531461dad8a660ba77b944510d0fa
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

libcxxabi: update to LLVM 23


19 files changed, 131 insertions(+), 95 deletions(-)

lib/libcxxabi/include/__cxxabi_config.h+6
......@@ -128,4 +128,10 @@
128128# define _LIBCXXABI_NOEXCEPT noexcept
129129#endif
130130
131#if defined(__POINTER_FIELD_PROTECTION_ABI__)
132# define _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION [[_Clang::__no_field_protection__]]
133#else
134# define _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION
135#endif
136
131137#endif // ____CXXABI_CONFIG_H
lib/libcxxabi/include/cxxabi.h+10-11
......@@ -19,8 +19,7 @@
1919
2020#include <__cxxabi_config.h>
2121
22#define _LIBCPPABI_VERSION 15000
23#define _LIBCXXABI_NORETURN __attribute__((noreturn))
22#define _LIBCPPABI_VERSION 230000
2423#define _LIBCXXABI_ALWAYS_COLD __attribute__((cold))
2524
2625#ifdef __cplusplus
......@@ -31,7 +30,7 @@ class _LIBCXXABI_TYPE_VIS type_info; // forward declaration
3130#else
3231class type_info; // forward declaration
3332#endif
34}
33} // namespace std
3534
3635
3736// runtime routines use C calling conventions, but are in __cxxabiv1 namespace
......@@ -56,7 +55,7 @@ __cxa_init_primary_exception(void* object, std::type_info* tinfo, void(_LIBCXXAB
5655#endif
5756
5857// 2.4.3 Throwing the Exception Object
59extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
58[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void
6059__cxa_throw(void *thrown_exception, std::type_info *tinfo,
6160#ifdef __wasm__
6261 void *(_LIBCXXABI_DTOR_FUNC *dest)(void *));
......@@ -80,22 +79,22 @@ extern _LIBCXXABI_FUNC_VIS std::type_info *__cxa_current_exception_type();
8079// GNU extension
8180// Calls `terminate` with the current exception being caught. This function is used by GCC when a `noexcept` function
8281// throws an exception inside a try/catch block and doesn't catch it.
83extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_call_terminate(void*) _LIBCXXABI_NOEXCEPT;
82[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_call_terminate(void*) _LIBCXXABI_NOEXCEPT;
8483
8584// 2.5.4 Rethrowing Exceptions
86extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_rethrow();
85[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_rethrow();
8786
8887// 2.6 Auxiliary Runtime APIs
89extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void);
90extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void);
91extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
88[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_bad_cast(void);
89[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_bad_typeid(void);
90[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void
9291__cxa_throw_bad_array_new_length(void);
9392
9493// 3.2.6 Pure Virtual Function API
95extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_pure_virtual(void);
94[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_pure_virtual(void);
9695
9796// 3.2.7 Deleted Virtual Function API
98extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
97[[__noreturn__]] extern _LIBCXXABI_FUNC_VIS void __cxa_deleted_virtual(void);
9998
10099// 3.3.2 One-time Construction API
101100#if defined(_LIBCXXABI_GUARD_ABI_ARM)
lib/libcxxabi/src/abort_message.h+1-1
......@@ -11,7 +11,7 @@
1111
1212#include "cxxabi.h"
1313
14extern "C" _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void
14extern "C" [[noreturn]] _LIBCXXABI_HIDDEN void
1515__abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
1616
1717#ifndef _LIBCXXABI_ASSERT
lib/libcxxabi/src/cxa_aux_runtime.cpp+3-3
......@@ -16,7 +16,7 @@
1616
1717namespace __cxxabiv1 {
1818extern "C" {
19_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void) {
19[[noreturn]] _LIBCXXABI_FUNC_VIS void __cxa_bad_cast(void) {
2020#ifndef _LIBCXXABI_NO_EXCEPTIONS
2121 throw std::bad_cast();
2222#else
......@@ -24,7 +24,7 @@ _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void) {
2424#endif
2525}
2626
27_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {
27[[noreturn]] _LIBCXXABI_FUNC_VIS void __cxa_bad_typeid(void) {
2828#ifndef _LIBCXXABI_NO_EXCEPTIONS
2929 throw std::bad_typeid();
3030#else
......@@ -32,7 +32,7 @@ _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {
3232#endif
3333}
3434
35_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
35[[noreturn]] _LIBCXXABI_FUNC_VIS void
3636__cxa_throw_bad_array_new_length(void) {
3737#ifndef _LIBCXXABI_NO_EXCEPTIONS
3838 throw std::bad_array_new_length();
lib/libcxxabi/src/cxa_default_handlers.cpp+4-6
......@@ -24,8 +24,7 @@
2424static constinit const char* cause = "uncaught";
2525
2626# ifndef _LIBCXXABI_NO_EXCEPTIONS
27__attribute__((noreturn))
28static void demangling_terminate_handler()
27[[noreturn]] static void demangling_terminate_handler()
2928{
3029 using namespace __cxxabiv1;
3130 __cxa_eh_globals* globals = __cxa_get_globals_fast();
......@@ -78,15 +77,14 @@ static void demangling_terminate_handler()
7877 }
7978}
8079#else // !_LIBCXXABI_NO_EXCEPTIONS
81__attribute__((noreturn))
82static void demangling_terminate_handler()
80[[noreturn]] static void demangling_terminate_handler()
8381{
82 (void)cause;
8483 __abort_message("terminating");
8584}
8685#endif // !_LIBCXXABI_NO_EXCEPTIONS
8786
88__attribute__((noreturn))
89static void demangling_unexpected_handler()
87[[noreturn]] static void demangling_unexpected_handler()
9088{
9189 cause = "unexpected";
9290 std::terminate();
lib/libcxxabi/src/cxa_exception.cpp+1-1
......@@ -140,7 +140,7 @@ exception_cleanup_func(_Unwind_Reason_Code reason, _Unwind_Exception* unwind_exc
140140 __cxa_decrement_exception_refcount(unwind_exception + 1);
141141}
142142
143static _LIBCXXABI_NORETURN void failed_throw(__cxa_exception* exception_header) {
143[[noreturn]] static void failed_throw(__cxa_exception* exception_header) {
144144// Section 2.5.3 says:
145145// * For purposes of this ABI, several things are considered exception handlers:
146146// ** A terminate() call due to a throw.
lib/libcxxabi/src/cxa_guard_impl.h+1-1
......@@ -637,7 +637,7 @@ struct GlobalStatic {
637637 static T instance;
638638};
639639template <class T>
640_LIBCPP_CONSTINIT T GlobalStatic<T>::instance = {};
640constinit T GlobalStatic<T>::instance = {};
641641
642642enum class Implementation { NoThreads, GlobalMutex, Futex };
643643
lib/libcxxabi/src/cxa_handlers.cpp+2-4
......@@ -36,8 +36,7 @@ __unexpected(unexpected_handler func)
3636 __abort_message("unexpected_handler unexpectedly returned");
3737}
3838
39__attribute__((noreturn))
40void
39[[noreturn]] void
4140unexpected()
4241{
4342 __unexpected(get_unexpected());
......@@ -69,8 +68,7 @@ __terminate(terminate_handler func) noexcept
6968#endif // _LIBCXXABI_NO_EXCEPTIONS
7069}
7170
72__attribute__((noreturn))
73void
71[[noreturn]] void
7472terminate() noexcept
7573{
7674#ifndef _LIBCXXABI_NO_EXCEPTIONS
lib/libcxxabi/src/cxa_handlers.h+2-2
......@@ -19,11 +19,11 @@
1919namespace std
2020{
2121
22_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
22[[noreturn]] _LIBCXXABI_HIDDEN
2323void
2424__unexpected(unexpected_handler func);
2525
26_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
26[[noreturn]] _LIBCXXABI_HIDDEN
2727void
2828__terminate(terminate_handler func) noexcept;
2929
lib/libcxxabi/src/cxa_personality.cpp+3-15
......@@ -23,7 +23,7 @@
2323
2424#if __has_feature(ptrauth_calls)
2525
26// CXXABI depends on defintions in libunwind as pointer auth couples the
26// CXXABI depends on definitions in libunwind as pointer auth couples the
2727// definitions
2828# include "libunwind.h"
2929
......@@ -67,15 +67,6 @@
6767# pragma clang diagnostic ignored "-Wmissing-prototypes"
6868#endif
6969
70// TODO: This is a temporary workaround for libc++abi to recognize that it's being
71// built against LLVM's libunwind. LLVM's libunwind started reporting _LIBUNWIND_VERSION
72// in LLVM 15 -- we can remove this workaround after shipping LLVM 17. Once we remove
73// this workaround, it won't be possible to build libc++abi against libunwind headers
74// from LLVM 14 and before anymore.
75#if defined(____LIBUNWIND_CONFIG_H__) && !defined(_LIBUNWIND_VERSION)
76# define _LIBUNWIND_VERSION
77#endif
78
7970#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
8071#include <windows.h>
8172#include <winnt.h>
......@@ -1125,9 +1116,7 @@ __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
11251116
11261117#else
11271118
1128// zig patch: https://github.com/llvm/llvm-project/issues/194232
1129extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*,
1130 _Unwind_Context*);
1119extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Context*);
11311120
11321121// Helper function to unwind one frame.
11331122// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the
......@@ -1283,8 +1272,7 @@ __gxx_personality_v0(_Unwind_State state,
12831272#endif
12841273
12851274
1286__attribute__((noreturn))
1287_LIBCXXABI_FUNC_VIS void
1275[[noreturn]] _LIBCXXABI_FUNC_VIS void
12881276__cxa_call_unexpected(void* arg)
12891277{
12901278 _Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(arg);
lib/libcxxabi/src/cxa_vector.cpp+1-2
......@@ -116,8 +116,7 @@ namespace {
116116//
117117
118118namespace {
119_LIBCXXABI_NORETURN
120void throw_bad_array_new_length() {
119[[noreturn]] void throw_bad_array_new_length() {
121120#ifndef _LIBCXXABI_NO_EXCEPTIONS
122121 throw std::bad_array_new_length();
123122#else
lib/libcxxabi/src/cxa_virtual.cpp+2-2
......@@ -11,12 +11,12 @@
1111
1212namespace __cxxabiv1 {
1313extern "C" {
14_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
14[[noreturn]] _LIBCXXABI_FUNC_VIS
1515void __cxa_pure_virtual(void) {
1616 __abort_message("Pure virtual function called!");
1717}
1818
19_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
19[[noreturn]] _LIBCXXABI_FUNC_VIS
2020void __cxa_deleted_virtual(void) {
2121 __abort_message("Deleted virtual function called!");
2222}
lib/libcxxabi/src/demangle/ItaniumDemangle.h+54
......@@ -1537,6 +1537,27 @@ public:
15371537 }
15381538};
15391539
1540class PackIndexing final : public Node {
1541 const Node *Pattern;
1542 const Node *Index;
1543
1544public:
1545 PackIndexing(const Node *Pattern_, const Node *Index_)
1546 : Node(KPackIndexing), Pattern(Pattern_), Index(Index_) {}
1547
1548 template <typename Fn> void match(Fn F) const { F(Pattern, Index); }
1549
1550 void printLeft(OutputBuffer &OB) const override {
1551 OB.printOpen('(');
1552 ParameterPackExpansion PPE(Pattern);
1553 PPE.printLeft(OB);
1554 OB.printClose(')');
1555 OB.printOpen('[');
1556 OB.printLeft(*Index);
1557 OB.printClose(']');
1558 }
1559};
1560
15401561class TemplateArgs final : public Node {
15411562 NodeArray Params;
15421563 Node *Requires;
......@@ -4531,6 +4552,18 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
45314552 Result = make<ParameterPackExpansion>(Child);
45324553 break;
45334554 }
4555 // ::= Dy <type> <expression> # pack indexing (C++26)
4556 case 'y': {
4557 First += 2;
4558 Node *Pattern = getDerived().parseType();
4559 if (!Pattern)
4560 return nullptr;
4561 Node *Index = getDerived().parseExpr();
4562 if (!Index)
4563 return nullptr;
4564 Result = make<PackIndexing>(Pattern, Index);
4565 break;
4566 }
45344567 // Exception specifier on a function type.
45354568 case 'o':
45364569 case 'O':
......@@ -5375,6 +5408,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
53755408 return nullptr;
53765409 return make<ParameterPackExpansion>(Child);
53775410 }
5411 if (consumeIf("sy")) {
5412 Node *Pattern = look() == 'T' ? getDerived().parseTemplateParam()
5413 : getDerived().parseFunctionParam();
5414 if (Pattern == nullptr)
5415 return nullptr;
5416 Node *Index = getDerived().parseExpr();
5417 if (Index == nullptr)
5418 return nullptr;
5419 return make<PackIndexing>(Pattern, Index);
5420 }
53785421 if (consumeIf("sZ")) {
53795422 if (look() == 'T') {
53805423 Node *R = getDerived().parseTemplateParam();
......@@ -6157,8 +6200,17 @@ AbstractManglingParser<Derived, Alloc>::parseTemplateArgs(bool TagTemplates) {
61576200// extension ::= ___Z <encoding> _block_invoke
61586201// extension ::= ___Z <encoding> _block_invoke<decimal-digit>+
61596202// extension ::= ___Z <encoding> _block_invoke_<decimal-digit>+
6203// extension ::= __alloc_token__Z <encoding>
6204// extension ::= __alloc_token_<decimal-digit>+__Z <encoding>
61606205template <typename Derived, typename Alloc>
61616206Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {
6207 bool AllocToken = consumeIf("__alloc_token_");
6208 if (AllocToken) {
6209 const char *Saved = First;
6210 if (parseNumber().empty() || !consumeIf('_'))
6211 First = Saved;
6212 }
6213
61626214 if (consumeIf("_Z") || consumeIf("__Z")) {
61636215 Node *Encoding = getDerived().parseEncoding(ParseParams);
61646216 if (Encoding == nullptr)
......@@ -6168,6 +6220,8 @@ Node *AbstractManglingParser<Derived, Alloc>::parse(bool ParseParams) {
61686220 make<DotSuffix>(Encoding, std::string_view(First, Last - First));
61696221 First = Last;
61706222 }
6223 if (AllocToken)
6224 Encoding = make<DotSuffix>(Encoding, ".alloc_token");
61716225 if (numLeft() != 0)
61726226 return nullptr;
61736227 return Encoding;
lib/libcxxabi/src/demangle/ItaniumNodes.def+1-1
......@@ -100,5 +100,5 @@ NODE(ExprRequirement)
100100NODE(TypeRequirement)
101101NODE(NestedRequirement)
102102NODE(ExplicitObjectParameter)
103
103NODE(PackIndexing)
104104#undef NODE
lib/libcxxabi/src/demangle/Utility.h+1-1
......@@ -31,7 +31,7 @@ class Node;
3131
3232// Stream that AST nodes write their string representation into after the AST
3333// has been parsed.
34class OutputBuffer {
34class DEMANGLE_ABI OutputBuffer {
3535 char *Buffer = nullptr;
3636 size_t CurrentPosition = 0;
3737 size_t BufferCapacity = 0;
lib/libcxxabi/src/fallback_malloc.cpp+2-2
......@@ -35,9 +35,9 @@ namespace {
3535
3636// When POSIX threads are not available, make the mutex operations a nop
3737#ifndef _LIBCXXABI_HAS_NO_THREADS
38static _LIBCPP_CONSTINIT std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;
38static constinit std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;
3939#else
40static _LIBCPP_CONSTINIT void* heap_mutex = 0;
40static constinit void* heap_mutex = 0;
4141#endif
4242
4343class mutexor {
lib/libcxxabi/src/private_typeinfo.cpp+18-20
......@@ -99,28 +99,27 @@ struct derived_object_info {
9999};
100100
101101/// A helper function that gets (dynamic_ptr, dynamic_type, offset_to_derived) from static_ptr.
102void dyn_cast_get_derived_info(derived_object_info* info, const void* static_ptr)
103{
102derived_object_info dyn_cast_get_derived_info(const void* static_ptr) {
103 derived_object_info info;
104104#if __has_feature(cxx_abi_relative_vtable)
105 // The vtable address will point to the first virtual function, which is 8
106 // bytes after the start of the vtable (4 for the offset from top + 4 for
107 // the typeinfo component).
108 const int32_t* vtable =
109 *reinterpret_cast<const int32_t* const*>(static_ptr);
110 info->offset_to_derived = static_cast<std::ptrdiff_t>(vtable[-2]);
111 info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;
112
113 // The typeinfo component is now a relative offset to a proxy.
114 int32_t offset_to_ti_proxy = vtable[-1];
115 const uint8_t* ptr_to_ti_proxy =
116 reinterpret_cast<const uint8_t*>(vtable) + offset_to_ti_proxy;
117 info->dynamic_type = *(reinterpret_cast<const __class_type_info* const*>(ptr_to_ti_proxy));
105 // The vtable address will point to the first virtual function, which is 8
106 // bytes after the start of the vtable (4 for the offset from top + 4 for
107 // the typeinfo component).
108 const int32_t* vtable = *reinterpret_cast<const int32_t* const*>(static_ptr);
109 info.offset_to_derived = static_cast<std::ptrdiff_t>(vtable[-2]);
110 info.dynamic_ptr = static_cast<const char*>(static_ptr) + info.offset_to_derived;
111
112 // The typeinfo component is now a relative offset to a proxy.
113 int32_t offset_to_ti_proxy = vtable[-1];
114 const uint8_t* ptr_to_ti_proxy = reinterpret_cast<const uint8_t*>(vtable) + offset_to_ti_proxy;
115 info.dynamic_type = *(reinterpret_cast<const __class_type_info* const*>(ptr_to_ti_proxy));
118116#else
119117 void** vtable = strip_vtable(*static_cast<void** const*>(static_ptr));
120 info->offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
121 info->dynamic_ptr = static_cast<const char*>(static_ptr) + info->offset_to_derived;
122 info->dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
118 info.offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
119 info.dynamic_ptr = static_cast<const char*>(static_ptr) + info.offset_to_derived;
120 info.dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
123121#endif
122 return info;
124123}
125124
126125/// A helper function for __dynamic_cast that casts a base sub-object pointer
......@@ -915,8 +914,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
915914 const __class_type_info *dst_type,
916915 std::ptrdiff_t src2dst_offset) {
917916 // Get (dynamic_ptr, dynamic_type) from static_ptr
918 derived_object_info derived_info;
919 dyn_cast_get_derived_info(&derived_info, static_ptr);
917 derived_object_info derived_info = dyn_cast_get_derived_info(static_ptr);
920918
921919 // Initialize answer to nullptr. This will be changed from the search
922920 // results if a non-null answer is found. Regardless, this is what will
lib/libcxxabi/src/private_typeinfo.h+3-3
......@@ -145,7 +145,7 @@ public:
145145// Has one non-virtual public base class at offset zero
146146class _LIBCXXABI_TYPE_VIS __si_class_type_info : public __class_type_info {
147147public:
148 const __class_type_info *__base_type;
148 _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION const __class_type_info* __base_type;
149149
150150 _LIBCXXABI_HIDDEN virtual ~__si_class_type_info();
151151
......@@ -204,7 +204,7 @@ public:
204204class _LIBCXXABI_TYPE_VIS __pbase_type_info : public __shim_type_info {
205205public:
206206 unsigned int __flags;
207 const __shim_type_info *__pointee;
207 _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION const __shim_type_info* __pointee;
208208
209209 enum __masks {
210210 __const_mask = 0x1,
......@@ -245,7 +245,7 @@ public:
245245class _LIBCXXABI_TYPE_VIS __pointer_to_member_type_info
246246 : public __pbase_type_info {
247247public:
248 const __class_type_info *__context;
248 _LIBCXXABI_DISABLE_POINTER_FIELD_PROTECTION const __class_type_info* __context;
249249
250250 _LIBCXXABI_HIDDEN virtual ~__pointer_to_member_type_info();
251251 _LIBCXXABI_HIDDEN virtual bool can_catch(const __shim_type_info *,
lib/libcxxabi/src/stdlib_new_delete.cpp+16-20
......@@ -20,10 +20,6 @@
2020# error The _THROW_BAD_ALLOC macro should be already defined by libc++
2121#endif
2222
23#ifndef _LIBCPP_WEAK
24# error The _LIBCPP_WEAK macro should be already defined by libc++
25#endif
26
2723#if defined(_LIBCXXABI_NO_EXCEPTIONS) != !_LIBCPP_HAS_EXCEPTIONS
2824# error libc++ and libc++abi seem to disagree on whether exceptions are enabled
2925#endif
......@@ -70,7 +66,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size) _THROW_BAD_ALLOC {
7066 return p;
7167}
7268
73_LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
69[[gnu::weak]] void* operator new(size_t size, const std::nothrow_t&) noexcept {
7470#if !_LIBCPP_HAS_EXCEPTIONS
7571# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
7672 _LIBCPP_ASSERT_SHIM(
......@@ -96,7 +92,7 @@ _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
9692
9793OVERRIDABLE_FUNCTION void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }
9894
99_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
95[[gnu::weak]] void* operator new[](size_t size, const std::nothrow_t&) noexcept {
10096#if !_LIBCPP_HAS_EXCEPTIONS
10197# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
10298 _LIBCPP_ASSERT_SHIM(
......@@ -120,17 +116,17 @@ _LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
120116#endif
121117}
122118
123_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }
119[[gnu::weak]] void operator delete(void* ptr) noexcept { std::free(ptr); }
124120
125_LIBCPP_WEAK void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }
121[[gnu::weak]] void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }
126122
127_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
123[[gnu::weak]] void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
128124
129_LIBCPP_WEAK void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
125[[gnu::weak]] void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
130126
131_LIBCPP_WEAK void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }
127[[gnu::weak]] void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }
132128
133_LIBCPP_WEAK void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }
129[[gnu::weak]] void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }
134130
135131#if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
136132
......@@ -161,7 +157,7 @@ OVERRIDABLE_FUNCTION void* operator new(std::size_t size, std::align_val_t align
161157 return p;
162158}
163159
164_LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
160[[gnu::weak]] void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
165161# if !_LIBCPP_HAS_EXCEPTIONS
166162# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
167163 _LIBCPP_ASSERT_SHIM(
......@@ -189,7 +185,7 @@ OVERRIDABLE_FUNCTION void* operator new[](size_t size, std::align_val_t alignmen
189185 return ::operator new(size, alignment);
190186}
191187
192_LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
188[[gnu::weak]] void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
193189# if !_LIBCPP_HAS_EXCEPTIONS
194190# if _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION
195191 _LIBCPP_ASSERT_SHIM(
......@@ -213,25 +209,25 @@ _LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const
213209# endif
214210}
215211
216_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
212[[gnu::weak]] void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
217213
218_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
214[[gnu::weak]] void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
219215 ::operator delete(ptr, alignment);
220216}
221217
222_LIBCPP_WEAK void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {
218[[gnu::weak]] void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {
223219 ::operator delete(ptr, alignment);
224220}
225221
226_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment) noexcept {
222[[gnu::weak]] void operator delete[](void* ptr, std::align_val_t alignment) noexcept {
227223 ::operator delete(ptr, alignment);
228224}
229225
230_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
226[[gnu::weak]] void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
231227 ::operator delete[](ptr, alignment);
232228}
233229
234_LIBCPP_WEAK void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {
230[[gnu::weak]] void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {
235231 ::operator delete[](ptr, alignment);
236232}
237233