Skip to content

Commit 61cc3cb

Browse files
6 failures
1 parent 1d9a7e9 commit 61cc3cb

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

libcxx/include/__tree

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,18 +1342,18 @@ private:
13421342
__node_holder __new_node = __construct_node(__src->__value_);
13431343

13441344
unique_ptr<__node, __tree_deleter> __left(
1345-
__copy_construct_tree(static_cast<__node_pointer>(__src->__left_)), __node_alloc_);
1346-
__node_pointer __right = __copy_construct_tree(static_cast<__node_pointer>(__src->__right_));
1345+
__copy_construct_tree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__left_)), __node_alloc_);
1346+
__node_pointer __right = __copy_construct_tree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__right_));
13471347

13481348
__node_pointer __new_node_ptr = __new_node.release();
13491349

13501350
__new_node_ptr->__is_black_ = __src->__is_black_;
1351-
__new_node_ptr->__left_ = static_cast<__node_base_pointer>(__left.release());
1352-
__new_node_ptr->__right_ = static_cast<__node_base_pointer>(__right);
1351+
__new_node_ptr->__left_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__left.release());
1352+
__new_node_ptr->__right_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__right);
13531353
if (__new_node_ptr->__left_)
1354-
__new_node_ptr->__left_->__parent_ = static_cast<__end_node_pointer>(__new_node_ptr);
1354+
__new_node_ptr->__left_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__new_node_ptr);
13551355
if (__new_node_ptr->__right_)
1356-
__new_node_ptr->__right_->__parent_ = static_cast<__end_node_pointer>(__new_node_ptr);
1356+
__new_node_ptr->__right_->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__new_node_ptr);
13571357
return __new_node_ptr;
13581358
}
13591359

@@ -1363,7 +1363,7 @@ private:
13631363
#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
13641364
_LIBCPP_HIDE_FROM_ABI
13651365
#endif
1366-
__node_pointer
1366+
_LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer
13671367
__copy_assign_tree(__node_pointer __dest, __node_pointer __src) {
13681368
if (!__src) {
13691369
destroy(__dest);
@@ -1375,24 +1375,24 @@ private:
13751375

13761376
// If we already have a left node in the destination tree, reuse it and copy-assign recursively
13771377
if (__dest->__left_) {
1378-
__dest->__left_ = static_cast<__node_base_pointer>(__copy_assign_tree(
1379-
static_cast<__node_pointer>(__dest->__left_), static_cast<__node_pointer>(__src->__left_)));
1378+
__dest->__left_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_assign_tree(
1379+
std::__static_fancy_pointer_cast<__node_pointer>(__dest->__left_), std::__static_fancy_pointer_cast<__node_pointer>(__src->__left_)));
13801380

13811381
// Otherwise, we must create new nodes; copy-construct from here on
13821382
} else if (__src->__left_) {
1383-
auto __new_left = __copy_construct_tree(static_cast<__node_pointer>(__src->__left_));
1384-
__dest->__left_ = static_cast<__node_base_pointer>(__new_left);
1385-
__new_left->__parent_ = static_cast<__end_node_pointer>(__dest);
1383+
auto __new_left = __copy_construct_tree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__left_));
1384+
__dest->__left_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__new_left);
1385+
__new_left->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__dest);
13861386
}
13871387

13881388
// Identical to the left case above, just for the right nodes
13891389
if (__dest->__right_) {
1390-
__dest->__right_ = static_cast<__node_base_pointer>(__copy_assign_tree(
1391-
static_cast<__node_pointer>(__dest->__right_), static_cast<__node_pointer>(__src->__right_)));
1390+
__dest->__right_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_assign_tree(
1391+
std::__static_fancy_pointer_cast<__node_pointer>(__dest->__right_), std::__static_fancy_pointer_cast<__node_pointer>(__src->__right_)));
13921392
} else if (__src->__right_) {
1393-
auto __new_right = __copy_construct_tree(static_cast<__node_pointer>(__src->__right_));
1394-
__dest->__right_ = static_cast<__node_base_pointer>(__new_right);
1395-
__new_right->__parent_ = static_cast<__end_node_pointer>(__dest);
1393+
auto __new_right = __copy_construct_tree(std::__static_fancy_pointer_cast<__node_pointer>(__src->__right_));
1394+
__dest->__right_ = std::__static_fancy_pointer_cast<__node_base_pointer>(__new_right);
1395+
__new_right->__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__dest);
13961396
}
13971397

13981398
return __dest;
@@ -1469,14 +1469,14 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Co
14691469
__copy_assign_alloc(__t);
14701470

14711471
if (__size_ != 0) {
1472-
*__root_ptr() = static_cast<__node_base_pointer>(__copy_assign_tree(__root(), __t.__root()));
1472+
*__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_assign_tree(__root(), __t.__root()));
14731473
} else {
1474-
*__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
1474+
*__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
14751475
if (__root())
14761476
__root()->__parent_ = __end_node();
14771477
}
14781478
__begin_node_ =
1479-
__end_node()->__left_ ? static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_)) : __end_node();
1479+
__end_node()->__left_ ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_)) : __end_node();
14801480
__size_ = __t.size();
14811481

14821482
return *this;
@@ -1533,9 +1533,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const __
15331533
if (__t.size() == 0)
15341534
return;
15351535

1536-
*__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
1536+
*__root_ptr() = std::__static_fancy_pointer_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
15371537
__root()->__parent_ = __end_node();
1538-
__begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1538+
__begin_node_ = std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
15391539
__size_ = __t.size();
15401540
}
15411541

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,35 @@ class tracking_allocator {
3535
using value_type = T;
3636
using propagate_on_container_copy_assignment = std::true_type;
3737

38-
tracking_allocator(std::vector<void*>& allocs) : allocs_(&allocs) {}
38+
TEST_CONSTEXPR_CXX26 tracking_allocator(std::vector<void*>& allocs) : allocs_(&allocs) {}
3939

4040
template <class U>
41-
tracking_allocator(const tracking_allocator<U>& other) : allocs_(other.allocs_) {}
41+
TEST_CONSTEXPR_CXX26 tracking_allocator(const tracking_allocator<U>& other) : allocs_(other.allocs_) {}
4242

43-
T* allocate(std::size_t n) {
43+
TEST_CONSTEXPR_CXX26 T* allocate(std::size_t n) {
4444
T* allocation = std::allocator<T>().allocate(n);
4545
allocs_->push_back(allocation);
4646
return allocation;
4747
}
4848

49-
void deallocate(T* ptr, std::size_t n) TEST_NOEXCEPT {
49+
TEST_CONSTEXPR_CXX26 void deallocate(T* ptr, std::size_t n) TEST_NOEXCEPT {
5050
auto res = std::remove(allocs_->begin(), allocs_->end(), ptr);
5151
assert(res != allocs_->end() && "Trying to deallocate memory from different allocator?");
5252
allocs_->erase(res);
5353
std::allocator<T>().deallocate(ptr, n);
5454
}
5555

56-
friend bool operator==(const tracking_allocator& lhs, const tracking_allocator& rhs) {
56+
TEST_CONSTEXPR_CXX26 friend bool operator==(const tracking_allocator& lhs, const tracking_allocator& rhs) {
5757
return lhs.allocs_ == rhs.allocs_;
5858
}
5959

60-
friend bool operator!=(const tracking_allocator& lhs, const tracking_allocator& rhs) {
60+
TEST_CONSTEXPR_CXX26 friend bool operator!=(const tracking_allocator& lhs, const tracking_allocator& rhs) {
6161
return lhs.allocs_ != rhs.allocs_;
6262
}
6363
};
6464

6565
struct NoOp {
66-
void operator()() {}
66+
TEST_CONSTEXPR_CXX26 void operator()() {}
6767
};
6868

6969
template <class Alloc, class AllocatorInvariant = NoOp>
@@ -261,10 +261,10 @@ TEST_CONSTEXPR_CXX26 bool test() {
261261
std::vector<void*>* rhs_allocs_;
262262

263263
public:
264-
AssertEmpty(std::vector<void*>& lhs_allocs, std::vector<void*>& rhs_allocs)
264+
TEST_CONSTEXPR_CXX26 AssertEmpty(std::vector<void*>& lhs_allocs, std::vector<void*>& rhs_allocs)
265265
: lhs_allocs_(&lhs_allocs), rhs_allocs_(&rhs_allocs) {}
266266

267-
void operator()() {
267+
TEST_CONSTEXPR_CXX26 void operator()() {
268268
assert(lhs_allocs_->empty());
269269
assert(rhs_allocs_->empty());
270270
}
@@ -305,6 +305,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
305305
out = in;
306306
out.erase(std::next(out.begin(), 17), out.end());
307307
}
308+
return true;
308309
}
309310

310311

0 commit comments

Comments
 (0)