Skip to content

Commit 85ef966

Browse files
authored
[libc++] Avoid including all of <thread> in <future> (#116541)
1 parent 486e1d9 commit 85ef966

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

libcxx/include/future

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
384384
# include <__system_error/error_category.h>
385385
# include <__system_error/error_code.h>
386386
# include <__system_error/error_condition.h>
387+
# include <__thread/thread.h>
387388
# include <__type_traits/add_lvalue_reference.h>
388389
# include <__type_traits/aligned_storage.h>
389390
# include <__type_traits/conditional.h>
@@ -397,7 +398,6 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
397398
# include <mutex>
398399
# include <new>
399400
# include <stdexcept>
400-
# include <thread>
401401
# include <version>
402402

403403
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -2071,6 +2071,7 @@ _LIBCPP_POP_MACROS
20712071
# include <exception>
20722072
# include <iosfwd>
20732073
# include <system_error>
2074+
# include <thread>
20742075
#endif
20752076

20762077
#endif // _LIBCPP_FUTURE

libcxx/test/libcxx/transitive_includes/cxx23.csv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,6 @@ functional tuple
445445
functional typeinfo
446446
functional unordered_map
447447
functional version
448-
future array
449-
future atomic
450448
future bitset
451449
future cctype
452450
future cerrno
@@ -475,7 +473,6 @@ future stdexcept
475473
future streambuf
476474
future string
477475
future string_view
478-
future thread
479476
future tuple
480477
future typeinfo
481478
future version

libcxx/test/libcxx/transitive_includes/cxx26.csv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ functional tuple
444444
functional typeinfo
445445
functional unordered_map
446446
functional version
447-
future array
448-
future atomic
449447
future bitset
450448
future cctype
451449
future cerrno
@@ -474,7 +472,6 @@ future stdexcept
474472
future streambuf
475473
future string
476474
future string_view
477-
future thread
478475
future tuple
479476
future typeinfo
480477
future version

libcxx/test/std/thread/futures/futures.async/async.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <chrono>
2828
#include <future>
2929
#include <memory>
30+
#include <thread>
3031

3132
#include "test_macros.h"
3233

0 commit comments

Comments
 (0)