[LLVMbugs] [Bug 22000] New: __bit_iterator move_backward looks incorrect

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 21 21:52:10 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=22000

            Bug ID: 22000
           Summary: __bit_iterator move_backward looks incorrect
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mike.marcin at gmail.com
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

move_backward is implemented as follows for __bit_iterator

template <class _Cp, bool _IsConst>
inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_Cp, false>
move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp,
_IsConst> __last, __bit_iterator<_Cp, false> __result)
{
    return _VSTD::copy(__first, __last, __result);
}

which copies [__first, __last) into the range beginning at __result where as
move_backward expects the destination range to end at __result.

the obvious correction is:

template <class _Cp, bool _IsConst>
inline _LIBCPP_INLINE_VISIBILITY
__bit_iterator<_Cp, false>
move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp,
_IsConst> __last, __bit_iterator<_Cp, false> __result)
{
    return _VSTD::copy_backward(__first, __last, __result);
}

-- 
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/20141222/a68a107f/attachment.html>


More information about the llvm-bugs mailing list