[libcxx-commits] [libcxx] [libc++] Avoid including shared_ptr.h in basic_ostream.h (PR #121049)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 24 07:18:59 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/121049.diff


2 Files Affected:

- (modified) libcxx/include/__fwd/memory.h (+3) 
- (modified) libcxx/include/__ostream/basic_ostream.h (+1-1) 


``````````diff
diff --git a/libcxx/include/__fwd/memory.h b/libcxx/include/__fwd/memory.h
index b9e151855ad7d8..564000997dec6c 100644
--- a/libcxx/include/__fwd/memory.h
+++ b/libcxx/include/__fwd/memory.h
@@ -20,6 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template <class _Tp>
 class _LIBCPP_TEMPLATE_VIS allocator;
 
+template <class _Tp>
+class _LIBCPP_TEMPLATE_VIS shared_ptr;
+
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___FWD_MEMORY_H
diff --git a/libcxx/include/__ostream/basic_ostream.h b/libcxx/include/__ostream/basic_ostream.h
index 6d24171bc0d6cf..cf4d26167aebde 100644
--- a/libcxx/include/__ostream/basic_ostream.h
+++ b/libcxx/include/__ostream/basic_ostream.h
@@ -14,7 +14,7 @@
 #if _LIBCPP_HAS_LOCALIZATION
 
 #  include <__exception/operations.h>
-#  include <__memory/shared_ptr.h>
+#  include <__fwd/memory.h>
 #  include <__memory/unique_ptr.h>
 #  include <__new/exceptions.h>
 #  include <__ostream/put_character_sequence.h>

``````````

</details>


https://github.com/llvm/llvm-project/pull/121049


More information about the libcxx-commits mailing list