Skip to content

Commit

Permalink
Revert "[libc++] ADL-proof <vector> by adding _VSTD:: qualification o…
Browse files Browse the repository at this point in the history
…n calls."

This reverts commit 40267cc.

Build fails, e.g. http://lab.llvm.org:8011/#/builders/23/builds/108
  • Loading branch information
metaflow committed Nov 19, 2020
1 parent a1702a2 commit 620adac
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 59 deletions.
4 changes: 2 additions & 2 deletions libcxx/include/__hash_table
Expand Up @@ -2728,9 +2728,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
__u.__bucket_list_.reset(__npp);
}
_VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
_VSTD::__swap_allocator(__bucket_list_.get_deleter().__alloc(),
__swap_allocator(__bucket_list_.get_deleter().__alloc(),
__u.__bucket_list_.get_deleter().__alloc());
_VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc());
__swap_allocator(__node_alloc(), __u.__node_alloc());
_VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
__p2_.swap(__u.__p2_);
__p3_.swap(__u.__p3_);
Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__split_buffer
Expand Up @@ -279,7 +279,7 @@ void
__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
{
while (__begin_ != __new_begin)
__alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++));
__alloc_traits::destroy(__alloc(), __to_address(__begin_++));
}

template <class _Tp, class _Allocator>
Expand All @@ -296,7 +296,7 @@ void
__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
{
while (__new_last != __end_)
__alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_));
__alloc_traits::destroy(__alloc(), __to_address(--__end_));
}

template <class _Tp, class _Allocator>
Expand Down Expand Up @@ -416,7 +416,7 @@ __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
_VSTD::swap(__begin_, __x.__begin_);
_VSTD::swap(__end_, __x.__end_);
_VSTD::swap(__end_cap(), __x.__end_cap());
_VSTD::__swap_allocator(__alloc(), __x.__alloc());
__swap_allocator(__alloc(), __x.__alloc());
}

template <class _Tp, class _Allocator>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__tree
Expand Up @@ -1819,7 +1819,7 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
using _VSTD::swap;
swap(__begin_node_, __t.__begin_node_);
swap(__pair1_.first(), __t.__pair1_.first());
_VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc());
__swap_allocator(__node_alloc(), __t.__node_alloc());
__pair3_.swap(__t.__pair3_);
if (size() == 0)
__begin_node() = __end_node();
Expand Down
12 changes: 6 additions & 6 deletions libcxx/include/deque
Expand Up @@ -1237,7 +1237,7 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
__map_.swap(__c.__map_);
_VSTD::swap(__start_, __c.__start_);
_VSTD::swap(size(), __c.size());
_VSTD::__swap_allocator(__alloc(), __c.__alloc());
__swap_allocator(__alloc(), __c.__alloc());
}

template <class _Tp, class _Allocator>
Expand Down Expand Up @@ -2376,7 +2376,7 @@ deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__f) {
__alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), *__f);
__alloc_traits::construct(__a, std::__to_address(__tx.__pos_), *__f);
}
}
}
Expand All @@ -2393,7 +2393,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)
for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
__alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_));
__alloc_traits::construct(__a, std::__to_address(__tx.__pos_));
}
}
}
Expand All @@ -2410,7 +2410,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
_ConstructTransaction __tx(this, __br);
for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
__alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), __v);
__alloc_traits::construct(__a, std::__to_address(__tx.__pos_), __v);
}
}

Expand Down Expand Up @@ -2708,7 +2708,7 @@ void
deque<_Tp, _Allocator>::pop_front()
{
allocator_type& __a = __base::__alloc();
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
__alloc_traits::destroy(__a, __to_address(*(__base::__map_.begin() +
__base::__start_ / __base::__block_size) +
__base::__start_ % __base::__block_size));
--__base::size();
Expand All @@ -2723,7 +2723,7 @@ deque<_Tp, _Allocator>::pop_back()
_LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");
allocator_type& __a = __base::__alloc();
size_type __p = __base::size() + __base::__start_ - 1;
__alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
__alloc_traits::destroy(__a, __to_address(*(__base::__map_.begin() +
__p / __base::__block_size) +
__p % __base::__block_size));
--__base::size();
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/forward_list
Expand Up @@ -603,7 +603,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
__is_nothrow_swappable<__node_allocator>::value)
#endif
{
_VSTD::__swap_allocator(__alloc(), __x.__alloc(),
__swap_allocator(__alloc(), __x.__alloc(),
integral_constant<bool, __node_traits::propagate_on_container_swap::value>());
using _VSTD::swap;
swap(__before_begin()->__next_, __x.__before_begin()->__next_);
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/list
Expand Up @@ -783,7 +783,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
"list::swap: Either propagate_on_container_swap must be true"
" or the allocators must compare equal");
using _VSTD::swap;
_VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
__swap_allocator(__node_alloc(), __c.__node_alloc());
swap(__sz(), __c.__sz());
swap(__end_, __c.__end_);
if (__sz() == 0)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/memory
Expand Up @@ -4898,7 +4898,7 @@ void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
#endif
{
_VSTD::__swap_allocator(__a1, __a2,
__swap_allocator(__a1, __a2,
integral_constant<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());
}

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/string
Expand Up @@ -3438,7 +3438,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
__alloc_traits::is_always_equal::value ||
__alloc() == __str.__alloc(), "swapping non-equal allocators");
_VSTD::swap(__r_.first(), __str.__r_.first());
_VSTD::__swap_allocator(__alloc(), __str.__alloc());
__swap_allocator(__alloc(), __str.__alloc());
}

// find
Expand Down
12 changes: 6 additions & 6 deletions libcxx/include/vector
Expand Up @@ -951,7 +951,7 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
{

__annotate_delete();
_VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
_VSTD::swap(this->__begin_, __v.__begin_);
_VSTD::swap(this->__end_, __v.__end_);
_VSTD::swap(this->__end_cap(), __v.__end_cap());
Expand All @@ -966,8 +966,8 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
{
__annotate_delete();
pointer __r = __v.__begin_;
_VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, __p, __v.__begin_);
_VSTD::__construct_forward_with_exception_guarantees(this->__alloc(), __p, this->__end_, __v.__end_);
__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, __p, __v.__begin_);
__construct_forward_with_exception_guarantees(this->__alloc(), __p, this->__end_, __v.__end_);
_VSTD::swap(this->__begin_, __v.__begin_);
_VSTD::swap(this->__end_, __v.__end_);
_VSTD::swap(this->__end_cap(), __v.__end_cap());
Expand Down Expand Up @@ -1074,7 +1074,7 @@ typename enable_if
vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
{
_ConstructTransaction __tx(*this, __n);
_VSTD::__construct_range_forward(this->__alloc(), __first, __last, __tx.__pos_);
__construct_range_forward(this->__alloc(), __first, __last, __tx.__pos_);
}

// Default constructs __n objects starting at __end_
Expand Down Expand Up @@ -2054,7 +2054,7 @@ vector<_Tp, _Allocator>::swap(vector& __x)
_VSTD::swap(this->__begin_, __x.__begin_);
_VSTD::swap(this->__end_, __x.__end_);
_VSTD::swap(this->__end_cap(), __x.__end_cap());
_VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
__swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
#if _LIBCPP_DEBUG_LEVEL == 2
__get_db()->swap(this, &__x);
Expand Down Expand Up @@ -3232,7 +3232,7 @@ vector<bool, _Allocator>::swap(vector& __x)
_VSTD::swap(this->__begin_, __x.__begin_);
_VSTD::swap(this->__size_, __x.__size_);
_VSTD::swap(this->__cap(), __x.__cap());
_VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
__swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());
}

Expand Down

This file was deleted.

0 comments on commit 620adac

Please sign in to comment.