forked from OSchip/llvm-project
[libc++] [LIBCXX-DEBUG-FIXME] std::advance shouldn't use ADL `>=` on the _Distance type.
Convert to a primitive type first; then use primitive `>=` on that value. Differential Revision: https://reviews.llvm.org/D101678
This commit is contained in:
parent
165ad89947
commit
9571b8f238
|
@ -538,10 +538,10 @@ template <class _InputIter, class _Distance>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||||
void advance(_InputIter& __i, _Distance __orig_n)
|
void advance(_InputIter& __i, _Distance __orig_n)
|
||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(__orig_n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
|
|
||||||
"Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
|
|
||||||
typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
|
typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
|
||||||
_IntegralSize __n = __orig_n;
|
_IntegralSize __n = __orig_n;
|
||||||
|
_LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
|
||||||
|
"Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
|
||||||
_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
|
_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// XFAIL: LIBCXX-DEBUG-FIXME
|
|
||||||
|
|
||||||
// <iterator>
|
// <iterator>
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
Loading…
Reference in New Issue