[llvm-bugs] [Bug 28421] New: non-conforming reverse_iterator::operator-

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 5 01:20:24 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28421

            Bug ID: 28421
           Summary: non-conforming reverse_iterator::operator-
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

>From [reverse.iter.opdif] in N4140:

template <class Iterator1, class Iterator2>
constexpr auto operator-(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y) -> decltype(y.base() - x.base());

but the current implementation is: 

template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename reverse_iterator<_Iter1>::difference_type
operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
__y)
{
    return __y.base() - __x.base(); // This is line 640
}

That is, return type expression SFINAE is not performed.

This breaks range-v3, see:
https://github.com/ericniebler/range-v3/issues/420#issuecomment-230414141

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160705/26b7f33b/attachment.html>


More information about the llvm-bugs mailing list