Skip to content

Commit a76ed12

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

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

libcxx/include/__exception/exception_ptr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
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>
2222
#include <typeinfo>
2323

2424
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -35,7 +35,7 @@ _LIBCPP_PUSH_MACROS
3535
namespace __cxxabiv1 {
3636

3737
extern "C" {
38-
_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(size_t) throw();
38+
_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(std::size_t) throw();
3939
_LIBCPP_OVERRIDABLE_FUNC_VIS void __cxa_free_exception(void*) throw();
4040

4141
struct __cxa_exception;

libcxx/include/exception

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ template <class E> void rethrow_if_nested(const E& e);
9797
# include <new>
9898
# include <type_traits>
9999
# endif
100+
101+
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
102+
# include <cstdlib>
103+
# endif
100104
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
101105

102106
#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)