Skip to content

Commit 728e585

Browse files
committed
[libc++] Remove <cstdlib> include from <exception>
1 parent f74e909 commit 728e585

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

libcxx/include/__exception/exception_ptr.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
#include <__config>
1313
#include <__cstddef/nullptr_t.h>
14+
#include <__cstddef/size_t.h>
1415
#include <__exception/operations.h>
1516
#include <__memory/addressof.h>
1617
#include <__memory/construct_at.h>
1718
#include <__type_traits/decay.h>
1819
#include <__type_traits/is_pointer.h>
1920
#include <__utility/move.h>
2021
#include <__utility/swap.h>
21-
#include <cstdlib>
22+
#include <__verbose_abort>
2223
#include <typeinfo>
2324

2425
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -35,7 +36,7 @@ _LIBCPP_PUSH_MACROS
3536
namespace __cxxabiv1 {
3637

3738
extern "C" {
38-
_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(size_t) throw();
39+
_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(std::size_t) throw();
3940
_LIBCPP_OVERRIDABLE_FUNC_VIS void __cxa_free_exception(void*) throw();
4041

4142
struct __cxa_exception;
@@ -174,7 +175,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
174175
# else // !_LIBCPP_HAS_EXCEPTIONS
175176
template <class _Ep>
176177
_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT {
177-
std::abort();
178+
_LIBCPP_VERBOSE_ABORT("make_exception_ptr was called in -fno-exceptions mode");
178179
}
179180
# endif // _LIBCPP_HAS_EXCEPTIONS
180181

libcxx/include/exception

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ template <class E> void rethrow_if_nested(const E& e);
9393

9494
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
9595
# include <cstddef>
96-
# include <cstdlib>
9796
# include <new>
9897
# include <type_traits>
9998
# endif
99+
100+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
101+
# include <cstdlib>
102+
# endif
100103
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
101104

102105
#endif // _LIBCPP_EXCEPTION

libcxx/test/libcxx/transitive_includes/cxx26.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ deque stdexcept
245245
deque tuple
246246
deque version
247247
exception cstdint
248-
exception cstdlib
249248
exception typeinfo
250249
exception version
251250
execution version

0 commit comments

Comments
 (0)