diff options
author | Arthur O'Dwyer <arthur.j.odwyer@gmail.com> | 2020-12-15 19:32:29 -0500 |
---|---|---|
committer | Arthur O'Dwyer <arthur.j.odwyer@gmail.com> | 2021-01-06 18:23:50 -0500 |
commit | 781c476ce09ed983477885e33b8acbb2220ad3a1 (patch) | |
tree | df110add2cbc1411dd67752014f5a1e15c98b322 /libcxx/include/__bit_reference | |
parent | 6d94eeadd28af4d488b5875778a3ebfa0d749b52 (diff) | |
download | llvm-781c476ce09ed983477885e33b8acbb2220ad3a1.tar.gz |
[libc++] ADL-proof vector<bool> by adding _VSTD:: qualification on calls.
This affects only vectors with weird/malicious allocators,
the same corner case covered in D91708, but for `vector<bool>` this time.
Also ADL-proof <__tree>, which affects only sets and maps with weird/malicious
allocators where the ADL trap is in the *fancy pointer type*.
Also drive-by _VSTD:: qualification in the guts of std::bind,
std::packaged_task, std::condition_variable.
Differential Revision: https://reviews.llvm.org/D93424
Diffstat (limited to 'libcxx/include/__bit_reference')
-rw-r--r-- | libcxx/include/__bit_reference | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference index 4a2b82064b3c..284ed0fb0d54 100644 --- a/libcxx/include/__bit_reference +++ b/libcxx/include/__bit_reference @@ -239,8 +239,8 @@ __bit_iterator<_Cp, _IsConst> find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast<bool>(__value_)) - return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); - return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); } // count @@ -313,8 +313,8 @@ typename __bit_iterator<_Cp, _IsConst>::difference_type count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast<bool>(__value_)) - return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); - return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); } // fill_n @@ -387,9 +387,9 @@ fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __v if (__n > 0) { if (__value_) - __fill_n_true(__first, __n); + _VSTD::__fill_n_true(__first, __n); else - __fill_n_false(__first, __n); + _VSTD::__fill_n_false(__first, __n); } } @@ -538,8 +538,8 @@ __bit_iterator<_Cp, false> copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { if (__first.__ctz_ == __result.__ctz_) - return __copy_aligned(__first, __last, __result); - return __copy_unaligned(__first, __last, __result); + return _VSTD::__copy_aligned(__first, __last, __result); + return _VSTD::__copy_unaligned(__first, __last, __result); } // copy_backward @@ -685,8 +685,8 @@ __bit_iterator<_Cp, false> copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { if (__last.__ctz_ == __result.__ctz_) - return __copy_backward_aligned(__first, __last, __result); - return __copy_backward_unaligned(__first, __last, __result); + return _VSTD::__copy_backward_aligned(__first, __last, __result); + return _VSTD::__copy_backward_unaligned(__first, __last, __result); } // move @@ -868,8 +868,8 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __ __bit_iterator<__C2, false> __first2) { if (__first1.__ctz_ == __first2.__ctz_) - return __swap_ranges_aligned(__first1, __last1, __first2); - return __swap_ranges_unaligned(__first1, __last1, __first2); + return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2); + return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2); } // rotate @@ -1083,8 +1083,8 @@ bool equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2) { if (__first1.__ctz_ == __first2.__ctz_) - return __equal_aligned(__first1, __last1, __first2); - return __equal_unaligned(__first1, __last1, __first2); + return _VSTD::__equal_aligned(__first1, __last1, __first2); + return _VSTD::__equal_unaligned(__first1, __last1, __first2); } template <class _Cp, bool _IsConst, |