Skip to content

Commit f470158

Browse files
at.pass.cpp passes again
1 parent 71b4ffb commit f470158

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

libcxx/include/__tree

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ public:
835835
return __t;
836836
}
837837

838-
_LIBCPP_HIDE_FROM_ABI __tree_const_iterator& operator--() {
838+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_const_iterator& operator--() {
839839
__ptr_ = static_cast<__end_node_pointer>(std::__tree_prev_iter<__node_base_pointer>(__ptr_));
840840
return *this;
841841
}
@@ -941,20 +941,20 @@ private:
941941
_LIBCPP_COMPRESSED_PAIR(size_type, __size_, value_compare, __value_comp_);
942942

943943
public:
944-
_LIBCPP_HIDE_FROM_ABI __end_node_pointer __end_node() _NOEXCEPT {
944+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer __end_node() _NOEXCEPT {
945945
return pointer_traits<__end_node_pointer>::pointer_to(__end_node_);
946946
}
947-
_LIBCPP_HIDE_FROM_ABI __end_node_pointer __end_node() const _NOEXCEPT {
947+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer __end_node() const _NOEXCEPT {
948948
return pointer_traits<__end_node_pointer>::pointer_to(const_cast<__end_node_t&>(__end_node_));
949949
}
950950
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_allocator& __node_alloc() _NOEXCEPT {
951951
return __node_alloc_;
952952
}
953953

954954
private:
955-
_LIBCPP_HIDE_FROM_ABI const __node_allocator& __node_alloc() const _NOEXCEPT { return __node_alloc_; }
956-
_LIBCPP_HIDE_FROM_ABI __end_node_pointer& __begin_node() _NOEXCEPT { return __begin_node_; }
957-
_LIBCPP_HIDE_FROM_ABI const __end_node_pointer& __begin_node() const _NOEXCEPT { return __begin_node_; }
955+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const __node_allocator& __node_alloc() const _NOEXCEPT { return __node_alloc_; }
956+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer& __begin_node() _NOEXCEPT { return __begin_node_; }
957+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const __end_node_pointer& __begin_node() const _NOEXCEPT { return __begin_node_; }
958958

959959
public:
960960
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type __alloc() const _NOEXCEPT {
@@ -1196,7 +1196,7 @@ public:
11961196
__emplace_hint_multi(__p, std::move(__value));
11971197
}
11981198

1199-
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool>
1199+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
12001200
__node_assign_unique(const __container_value_type& __v, __node_pointer __dest);
12011201

12021202
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator __node_insert_multi(__node_pointer __nd);
@@ -1405,7 +1405,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const va
14051405
}
14061406

14071407
template <class _Tp, class _Compare, class _Allocator>
1408-
__tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
1408+
_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
14091409
: __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {
14101410
__begin_node() = __end_node();
14111411
}
@@ -1514,7 +1514,7 @@ __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _Input
15141514
}
15151515

15161516
template <class _Tp, class _Compare, class _Allocator>
1517-
__tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
1517+
_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
15181518
: __begin_node_(),
15191519
__node_alloc_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),
15201520
__size_(0),
@@ -1944,7 +1944,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 typename __tree<_Tp, _Compare, _Allocator>::__node
19441944
__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
19451945
__node_allocator& __na = __node_alloc();
19461946
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1947-
__node_traits::construct(__na, std::addressof(__h->__value_), std::forward<_Args>(__args)...);
1947+
__node_traits::construct(__na, std::addressof(*__h), std::forward<_Args>(__args)...);
1948+
// __node_traits::construct(__na, std::addressof(__h->__value_), std::forward<_Args>(__args)...);
1949+
// note: construction of subobject of object outside its lifetime is not allowed in a constant expression
19481950
__h.get_deleter().__value_constructed = true;
19491951
return __h;
19501952
}

0 commit comments

Comments
 (0)