[libcxx-commits] [libcxx] 85ef966 - [libc++] Avoid including all of <thread> in <future> (#116541)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 18 11:04:08 PST 2024


Author: Nikolas Klauser
Date: 2024-11-18T20:04:05+01:00
New Revision: 85ef9666c892d5e11fce3a0b84e4eaf4603256ee

URL: https://github.com/llvm/llvm-project/commit/85ef9666c892d5e11fce3a0b84e4eaf4603256ee
DIFF: https://github.com/llvm/llvm-project/commit/85ef9666c892d5e11fce3a0b84e4eaf4603256ee.diff

LOG: [libc++] Avoid including all of <thread> in <future> (#116541)

Added: 
    

Modified: 
    libcxx/include/future
    libcxx/test/libcxx/transitive_includes/cxx23.csv
    libcxx/test/libcxx/transitive_includes/cxx26.csv
    libcxx/test/std/thread/futures/futures.async/async.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/future b/libcxx/include/future
index 9f7c95e542fd60..cbf3ed93464176 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -384,6 +384,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
 #  include <__system_error/error_category.h>
 #  include <__system_error/error_code.h>
 #  include <__system_error/error_condition.h>
+#  include <__thread/thread.h>
 #  include <__type_traits/add_lvalue_reference.h>
 #  include <__type_traits/aligned_storage.h>
 #  include <__type_traits/conditional.h>
@@ -397,7 +398,6 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
 #  include <mutex>
 #  include <new>
 #  include <stdexcept>
-#  include <thread>
 #  include <version>
 
 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -2071,6 +2071,7 @@ _LIBCPP_POP_MACROS
 #  include <exception>
 #  include <iosfwd>
 #  include <system_error>
+#  include <thread>
 #endif
 
 #endif // _LIBCPP_FUTURE

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx23.csv b/libcxx/test/libcxx/transitive_includes/cxx23.csv
index 791aad29710b5a..a008b4d76edde6 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx23.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx23.csv
@@ -445,8 +445,6 @@ functional tuple
 functional typeinfo
 functional unordered_map
 functional version
-future array
-future atomic
 future bitset
 future cctype
 future cerrno
@@ -475,7 +473,6 @@ future stdexcept
 future streambuf
 future string
 future string_view
-future thread
 future tuple
 future typeinfo
 future version

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index 78c457a22c31d2..d5321da32b3d46 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -444,8 +444,6 @@ functional tuple
 functional typeinfo
 functional unordered_map
 functional version
-future array
-future atomic
 future bitset
 future cctype
 future cerrno
@@ -474,7 +472,6 @@ future stdexcept
 future streambuf
 future string
 future string_view
-future thread
 future tuple
 future typeinfo
 future version

diff  --git a/libcxx/test/std/thread/futures/futures.async/async.pass.cpp b/libcxx/test/std/thread/futures/futures.async/async.pass.cpp
index 7e0d82f0d65890..109372b50a3117 100644
--- a/libcxx/test/std/thread/futures/futures.async/async.pass.cpp
+++ b/libcxx/test/std/thread/futures/futures.async/async.pass.cpp
@@ -27,6 +27,7 @@
 #include <chrono>
 #include <future>
 #include <memory>
+#include <thread>
 
 #include "test_macros.h"
 


        


More information about the libcxx-commits mailing list