Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Remove get_temporary_buffer/return_temporary_buffer #100914

Merged
merged 31 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f7ff07e
[libc++] Remove functions deprecated in C++17 and removed in C++20
frederick-vs-ja Jul 28, 2024
25a9782
Document escape hatches to 20.rst
frederick-vs-ja Aug 1, 2024
038af58
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Aug 3, 2024
60212b2
Split changes for `uncaught_exception` to another PR
frederick-vs-ja Aug 3, 2024
2841f72
Split changes for `uncaught_exception` to another PR (completing)
frederick-vs-ja Aug 3, 2024
d0f6edf
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Aug 4, 2024
5268aa9
Attempt to create `__scoped_temporary_buffer`
frederick-vs-ja Aug 4, 2024
3529007
Try to fix errors: module map, no CTAD
frederick-vs-ja Aug 4, 2024
2a71c0e
Try to fix inclusion error for `__libcpp_is_constant_evaluated`
frederick-vs-ja Aug 5, 2024
6d42fd6
Release `__release` to `__release_to_raw`
frederick-vs-ja Aug 5, 2024
cfc0ef5
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Aug 5, 2024
3cc9bb7
Merge remote-tracking branch 'llvm-fork/main' into libcxx-cxx20-removal
frederick-vs-ja Aug 23, 2024
9e2567a
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Aug 26, 2024
ffce43a
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Aug 28, 2024
b83103b
Avoid UB in deallocating null pointer value
frederick-vs-ja Aug 28, 2024
c812180
Make legacy member functions unconditionally available
frederick-vs-ja Aug 28, 2024
f6e94f7
Also add comment for `__release_to_raw`
frederick-vs-ja Aug 28, 2024
5c50d6a
Use `nullptr` and internal assertion from review comments
frederick-vs-ja Sep 1, 2024
2890c1d
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Sep 1, 2024
b8de11d
Restore the note changes in Cxx20Papers.csv
frederick-vs-ja Sep 1, 2024
eda4edf
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Sep 1, 2024
1f3fde7
Switch to use `unique_ptr`-based approach
frederick-vs-ja Sep 1, 2024
5e4b157
Fix copy-pasta
frederick-vs-ja Sep 1, 2024
2bd52cb
Fix CI failures
frederick-vs-ja Sep 1, 2024
51b18a2
Fix bad `return;`
frederick-vs-ja Sep 1, 2024
0961a50
Address review comments for `unique_ptr`-based buffer
frederick-vs-ja Sep 1, 2024
dc503fa
Use alias template
frederick-vs-ja Sep 1, 2024
74f4c4a
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Sep 1, 2024
1406cd5
Clang-format for CI purpose
frederick-vs-ja Sep 1, 2024
de9a474
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Sep 1, 2024
fa30053
Merge branch 'main' into libcxx-cxx20-removal
frederick-vs-ja Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libcxx/docs/ReleaseNotes/20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Improvements and New Features
- The ``lexicographical_compare`` and ``ranges::lexicographical_compare`` algorithms have been optimized for trivially
equality comparable types, resulting in a performance improvement of up to 40x.

- The ``_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER`` macro has been added to make ``std::get_temporary_buffer`` and
``std::return_temporary_buffer`` available.

- The ``_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION`` macro has been added to make ``std::uncaught_exception`` available in C++20 and later modes.


Expand Down
2 changes: 1 addition & 1 deletion libcxx/docs/Status/Cxx20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Paper Status
.. [#note-P0645] P0645: The implementation was complete since Clang 14,
except the feature-test macro was not set until Clang 19.
.. [#note-P0966] P0966: It was previously erroneously marked as complete in version 8.0. See `bug 45368 <https://llvm.org/PR45368>`__.
.. [#note-P0619] P0619: Only sections D.7, D.8, D.9, D.10, D.11 and D.13 are implemented. Sections D.4 and D.12 remain undone.
.. [#note-P0619] P0619: Only sections D.7, D.8, D.9, D.10, D.11, D.12, and D.13 are implemented. Section D.4 remains undone.
.. [#note-P0883.1] P0883: shared_ptr and floating-point changes weren't applied as they themselves aren't implemented yet.
.. [#note-P0883.2] P0883: ``ATOMIC_FLAG_INIT`` was marked deprecated in version 14.0, but was undeprecated with the implementation of LWG3659 in version 15.0.
.. [#note-P0660] P0660: The paper is implemented but the features are experimental and can be enabled via ``-fexperimental-library``.
Expand Down
3 changes: 3 additions & 0 deletions libcxx/docs/UserDocumentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ C++20 Specific Configuration Macros
**_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR**:
This macro is used to re-enable `raw_storage_iterator`.

**_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER**:
This macro is used to re-enable `get_temporary_buffer` and `return_temporary_buffer`.

**_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS**:
This macro is used to re-enable `is_literal_type`, `is_literal_type_v`,
`result_of` and `result_of_t`.
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ set(files
__memory/ranges_construct_at.h
__memory/ranges_uninitialized_algorithms.h
__memory/raw_storage_iterator.h
__memory/scoped_temporary_buffer.h
__memory/shared_ptr.h
__memory/swap_allocator.h
__memory/temp_value.h
Expand Down
18 changes: 11 additions & 7 deletions libcxx/include/__algorithm/inplace_merge.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__memory/destruct_n.h>
#include <__memory/temporary_buffer.h>
#include <__memory/scoped_temporary_buffer.h>
#include <__memory/unique_ptr.h>
#include <__utility/pair.h>
#include <new>
Expand Down Expand Up @@ -211,13 +211,17 @@ _LIBCPP_HIDE_FROM_ABI void __inplace_merge(
difference_type __len1 = _IterOps<_AlgPolicy>::distance(__first, __middle);
difference_type __len2 = _IterOps<_AlgPolicy>::distance(__middle, __last);
difference_type __buf_size = std::min(__len1, __len2);
// TODO: Remove the use of std::get_temporary_buffer
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
pair<value_type*, ptrdiff_t> __buf = std::get_temporary_buffer<value_type>(__buf_size);
_LIBCPP_SUPPRESS_DEPRECATED_POP
unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first);
__scoped_temporary_buffer<value_type> __scoped_buf(__buf_size);
__temporary_allocation_result<value_type> __buf_state = __scoped_buf.__get();
return std::__inplace_merge<_AlgPolicy>(
std::move(__first), std::move(__middle), std::move(__last), __comp, __len1, __len2, __buf.first, __buf.second);
std::move(__first),
std::move(__middle),
std::move(__last),
__comp,
__len1,
__len2,
__buf_state.__ptr,
__buf_state.__count);
}

template <class _BidirectionalIterator, class _Compare>
Expand Down
24 changes: 11 additions & 13 deletions libcxx/include/__algorithm/stable_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
#include <__memory/destruct_n.h>
#include <__memory/temporary_buffer.h>
#include <__memory/scoped_temporary_buffer.h>
#include <__memory/unique_ptr.h>
#include <__utility/move.h>
#include <__utility/pair.h>
Expand Down Expand Up @@ -132,14 +132,13 @@ __stable_partition_impl(_ForwardIterator __first, _ForwardIterator __last, _Pred
// We now have a reduced range [__first, __last)
// *__first is known to be false
difference_type __len = _IterOps<_AlgPolicy>::distance(__first, __last);
__scoped_temporary_buffer<value_type> __scoped_buf;
pair<value_type*, ptrdiff_t> __p(0, 0);
unique_ptr<value_type, __return_temporary_buffer> __h;
if (__len >= __alloc_limit) {
// TODO: Remove the use of std::get_temporary_buffer
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
__p = std::get_temporary_buffer<value_type>(__len);
_LIBCPP_SUPPRESS_DEPRECATED_POP
__h.reset(__p.first);
__scoped_buf.__try_allocate(__len);
__temporary_allocation_result<value_type> __buf_state = __scoped_buf.__get();
__p.first = __buf_state.__ptr;
__p.second = __buf_state.__count;
}
return std::__stable_partition_impl<_AlgPolicy, _Predicate&>(
std::move(__first), std::move(__last), __pred, __len, __p, forward_iterator_tag());
Expand Down Expand Up @@ -272,14 +271,13 @@ _LIBCPP_HIDE_FROM_ABI _BidirectionalIterator __stable_partition_impl(
// *__last is known to be true
// __len >= 2
difference_type __len = _IterOps<_AlgPolicy>::distance(__first, __last) + 1;
__scoped_temporary_buffer<value_type> __scoped_buf;
pair<value_type*, ptrdiff_t> __p(0, 0);
unique_ptr<value_type, __return_temporary_buffer> __h;
if (__len >= __alloc_limit) {
// TODO: Remove the use of std::get_temporary_buffer
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
__p = std::get_temporary_buffer<value_type>(__len);
_LIBCPP_SUPPRESS_DEPRECATED_POP
__h.reset(__p.first);
__scoped_buf.__try_allocate(__len);
__temporary_allocation_result<value_type> __buf_state = __scoped_buf.__get();
__p.first = __buf_state.__ptr;
__p.second = __buf_state.__count;
}
return std::__stable_partition_impl<_AlgPolicy, _Predicate&>(
std::move(__first), std::move(__last), __pred, __len, __p, bidirectional_iterator_tag());
Expand Down
13 changes: 6 additions & 7 deletions libcxx/include/__algorithm/stable_sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <__debug_utils/strict_weak_ordering_check.h>
#include <__iterator/iterator_traits.h>
#include <__memory/destruct_n.h>
#include <__memory/temporary_buffer.h>
#include <__memory/scoped_temporary_buffer.h>
#include <__memory/unique_ptr.h>
#include <__type_traits/is_trivially_assignable.h>
#include <__utility/move.h>
Expand Down Expand Up @@ -241,14 +241,13 @@ __stable_sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last,
using difference_type = typename iterator_traits<_RandomAccessIterator>::difference_type;

difference_type __len = __last - __first;
__scoped_temporary_buffer<value_type> __scoped_buf;
pair<value_type*, ptrdiff_t> __buf(0, 0);
unique_ptr<value_type, __return_temporary_buffer> __h;
if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value)) {
// TODO: Remove the use of std::get_temporary_buffer
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
__buf = std::get_temporary_buffer<value_type>(__len);
_LIBCPP_SUPPRESS_DEPRECATED_POP
__h.reset(__buf.first);
__scoped_buf.__try_allocate(__len);
__temporary_allocation_result<value_type> __buf_state = __scoped_buf.__get();
__buf.first = __buf_state.__ptr;
__buf.second = __buf_state.__count;
}

std::__stable_sort<_AlgPolicy, __comp_ref_type<_Compare> >(__first, __last, __comp, __len, __buf.first, __buf.second);
Expand Down
122 changes: 122 additions & 0 deletions libcxx/include/__memory/scoped_temporary_buffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___MEMORY_SCOPED_TEMPORARY_BUFFER_H
#define _LIBCPP___MEMORY_SCOPED_TEMPORARY_BUFFER_H

#include <__config>
#include <__memory/allocator.h>
#include <__type_traits/is_constant_evaluated.h>
#include <cstddef>
#include <new>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

_LIBCPP_BEGIN_NAMESPACE_STD
frederick-vs-ja marked this conversation as resolved.
Show resolved Hide resolved

template <class _Tp>
struct __temporary_allocation_result {
_Tp* __ptr;
ptrdiff_t __count;
};
frederick-vs-ja marked this conversation as resolved.
Show resolved Hide resolved

template <class _Tp>
class __scoped_temporary_buffer {
public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __scoped_temporary_buffer() _NOEXCEPT
: __ptr_(NULL),
frederick-vs-ja marked this conversation as resolved.
Show resolved Hide resolved
__count_(0) {}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __scoped_temporary_buffer(ptrdiff_t __count) _NOEXCEPT
: __ptr_(NULL),
frederick-vs-ja marked this conversation as resolved.
Show resolved Hide resolved
__count_(0) {
__try_allocate(__count);
}

// This constructor is only needed to implement get_temporary_buffer().
// pre: __buf_ptr points to the beginning of a previously allocated scoped temporary buffer or is null
// notes: __count_ is ignored in non-constant evaluation
_LIBCPP_HIDE_FROM_ABI explicit __scoped_temporary_buffer(_Tp* __buf_ptr) _NOEXCEPT : __ptr_(__buf_ptr), __count_(0) {}

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__scoped_temporary_buffer() _NOEXCEPT {
if (__libcpp_is_constant_evaluated()) {
if (__ptr_)
allocator<_Tp>().deallocate(__ptr_, __count_);
return;
}

std::__libcpp_deallocate_unsized((void*)__ptr_, _LIBCPP_ALIGNOF(_Tp));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why unsized when we have the count?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just copied from the old code. I think we can refactor this quite a bit, but I would tackle that as a follow-up patch.

}

__scoped_temporary_buffer(const __scoped_temporary_buffer&) = delete;
__scoped_temporary_buffer& operator=(const __scoped_temporary_buffer&) = delete;

// pre: __ptr_ == nullptr && __count_ == 0
frederick-vs-ja marked this conversation as resolved.
Show resolved Hide resolved
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __try_allocate(ptrdiff_t __count) _NOEXCEPT {
if (__libcpp_is_constant_evaluated()) {
__ptr_ = allocator<_Tp>().allocate(__count);
__count_ = __count;
return;
}

const ptrdiff_t __max_count =
(~ptrdiff_t(0) ^ ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * __CHAR_BIT__ - 1))) / sizeof(_Tp);
if (__count > __max_count)
__count = __max_count;
while (__count > 0) {
#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp))) {
align_val_t __al = align_val_t(_LIBCPP_ALIGNOF(_Tp));
__ptr_ = static_cast<_Tp*>(::operator new(__count * sizeof(_Tp), __al, nothrow));
} else {
__ptr_ = static_cast<_Tp*>(::operator new(__count * sizeof(_Tp), nothrow));
}
#else
if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp))) {
// Since aligned operator new is unavailable, constructs an empty buffer rather than one with invalid alignment.
return;
}

__ptr_ = static_cast<_Tp*>(::operator new(__count * sizeof(_Tp), nothrow));
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same logic __libcpp_operator_new implements?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I'd be in favour of copy-pasting the implementation of get_temporary_buffer() (what was done here) and then refactoring it, to avoid any unintended fallout from this patch.


if (__ptr_) {
__count_ = __count;
break;
}
__count_ /= 2;
}
}

_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __temporary_allocation_result<_Tp>
__get() const _NOEXCEPT {
__temporary_allocation_result<_Tp> __result = {__ptr_, __count_};
return __result;
}

// This member function is only needed to implement get_temporary_buffer().
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI __temporary_allocation_result<_Tp> __release_to_raw() _NOEXCEPT {
ldionne marked this conversation as resolved.
Show resolved Hide resolved
__temporary_allocation_result<_Tp> __result = {__ptr_, __count_};

__ptr_ = NULL;
__count_ = 0;

return __result;
}

private:
_Tp* __ptr_;
ptrdiff_t __count_;
};

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP___MEMORY_SCOPED_TEMPORARY_BUFFER_H
50 changes: 10 additions & 40 deletions libcxx/include/__memory/temporary_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define _LIBCPP___MEMORY_TEMPORARY_BUFFER_H

#include <__config>
#include <__memory/scoped_temporary_buffer.h>
#include <__utility/pair.h>
#include <cstddef>
#include <new>
Expand All @@ -19,57 +20,26 @@
# pragma GCC system_header
#endif

#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER)

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp>
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 pair<_Tp*, ptrdiff_t>
get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT {
pair<_Tp*, ptrdiff_t> __r(0, 0);
const ptrdiff_t __m =
(~ptrdiff_t(0) ^ ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * __CHAR_BIT__ - 1))) / sizeof(_Tp);
if (__n > __m)
__n = __m;
while (__n > 0) {
#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp))) {
align_val_t __al = align_val_t(_LIBCPP_ALIGNOF(_Tp));
__r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), __al, nothrow));
} else {
__r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow));
}
#else
if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp))) {
// Since aligned operator new is unavailable, return an empty
// buffer rather than one with invalid alignment.
return __r;
}

__r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow));
#endif

if (__r.first) {
__r.second = __n;
break;
}
__n /= 2;
}
return __r;
__scoped_temporary_buffer<_Tp> __scoped_buf(__n);
__temporary_allocation_result<_Tp> __result = __scoped_buf.__release_to_raw();
return pair<_Tp*, ptrdiff_t>(__result.__ptr, __result.__count);
}

template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX17 void return_temporary_buffer(_Tp* __p) _NOEXCEPT {
std::__libcpp_deallocate_unsized((void*)__p, _LIBCPP_ALIGNOF(_Tp));
__scoped_temporary_buffer<_Tp> __scoped_buf(__p);
(void)__scoped_buf;
}

struct __return_temporary_buffer {
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI void operator()(_Tp* __p) const {
std::return_temporary_buffer(__p);
}
_LIBCPP_SUPPRESS_DEPRECATED_POP
};

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER)

#endif // _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
4 changes: 2 additions & 2 deletions libcxx/include/memory
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ public:
raw_storage_iterator operator++(int);
};

template <class T> pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept;
template <class T> void return_temporary_buffer(T* p) noexcept;
template <class T> pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept; // deprecated in C++17, removed in C++20
template <class T> void return_temporary_buffer(T* p) noexcept; // deprecated in C++17, removed in C++20

template <class T> T* addressof(T& r) noexcept;
template <class T> T* addressof(const T&& r) noexcept = delete;
Expand Down
4 changes: 4 additions & 0 deletions libcxx/include/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,10 @@ module std_private_memory_ranges_uninitialized_algorithms [system] {
export std_private_algorithm_in_out_result
}
module std_private_memory_raw_storage_iterator [system] { header "__memory/raw_storage_iterator.h" }
module std_private_memory_scoped_temporary_buffer [system] {
header "__memory/scoped_temporary_buffer.h"
export std_private_type_traits_is_constant_evaluated
}
module std_private_memory_shared_ptr [system] {
header "__memory/shared_ptr.h"
export std_private_memory_uninitialized_algorithms
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/syncstream
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ private:
// TODO Use a more generic buffer.
// That buffer should be light with almost no additional headers. Then
// it can be use here, the __retarget_buffer, and place that use
// the now deprecated get_temporary_buffer
// the now removed get_temporary_buffer

basic_string<_CharT, _Traits, _Allocator> __str_;
bool __emit_on_sync_{false};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

// check that <memory> functions are marked [[nodiscard]]

// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS

// clang-format off
Expand Down
Loading
Loading