Skip to content

Commit 01d8633

Browse files
fix copy_assign.pass.cpp
1 parent d8095a7 commit 01d8633

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

libcxx/include/__tree

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,9 +1317,9 @@ public:
13171317
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __copy_assign_alloc(const __tree&, false_type) {}
13181318

13191319
private:
1320-
_LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_leaf_low(__parent_pointer& __parent, const key_type& __v);
1321-
_LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_leaf_high(__parent_pointer& __parent, const key_type& __v);
1322-
_LIBCPP_HIDE_FROM_ABI __node_base_pointer&
1320+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer& __find_leaf_low(__parent_pointer& __parent, const key_type& __v);
1321+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer& __find_leaf_high(__parent_pointer& __parent, const key_type& __v);
1322+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_base_pointer&
13231323
__find_leaf(const_iterator __hint, __parent_pointer& __parent, const key_type& __v);
13241324

13251325
template <class... _Args>
@@ -1679,7 +1679,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 void __tree<_Tp, _Compare, _Allocator>::clear() _N
16791679
// Set __parent to parent of null leaf
16801680
// Return reference to null leaf
16811681
template <class _Tp, class _Compare, class _Allocator>
1682-
typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
1682+
_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
16831683
__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__parent_pointer& __parent, const key_type& __v) {
16841684
__node_pointer __nd = __root();
16851685
if (__nd != nullptr) {
@@ -1709,7 +1709,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__parent_pointer& __parent, c
17091709
// Set __parent to parent of null leaf
17101710
// Return reference to null leaf
17111711
template <class _Tp, class _Compare, class _Allocator>
1712-
typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
1712+
_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
17131713
__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__parent_pointer& __parent, const key_type& __v) {
17141714
__node_pointer __nd = __root();
17151715
if (__nd != nullptr) {
@@ -1742,7 +1742,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__parent_pointer& __parent,
17421742
// Set __parent to parent of null leaf
17431743
// Return reference to null leaf
17441744
template <class _Tp, class _Compare, class _Allocator>
1745-
typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
1745+
_LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
17461746
__tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint, __parent_pointer& __parent, const key_type& __v) {
17471747
if (__hint == end() || !value_comp()(*__hint, __v)) // check before
17481748
{

libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class counting_allocatorF {
9292
}
9393
};
9494

95-
bool balanced_allocs() {
95+
TEST_CONSTEXPR_CXX26 bool balanced_allocs() {
9696
std::vector<int> temp1, temp2;
9797

9898
std::printf("Allocations = %zu, deallocations = %zu\n", ca_allocs.size(), ca_deallocs.size());
@@ -244,6 +244,13 @@ TEST_CONSTEXPR_CXX26 bool test() {
244244
assert(*std::next(mo.begin(), 2) == V(3, 1));
245245
}
246246

247+
248+
// Following code uses global vectors ca_allocs and ca_deallocs
249+
// Using globals/statics at compile time is not possible, so we exit early.
250+
#if TEST_STD_VER >= 26
251+
return true;
252+
#endif
253+
247254
assert(balanced_allocs());
248255
{
249256
typedef std::pair<const int, double> V;

0 commit comments

Comments
 (0)