[LLVMbugs] [Bug 19840] New: Tests for lexicographical_compare have copy/paste error

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 23 08:15:25 PDT 2014


            Bug ID: 19840
           Summary: Tests for lexicographical_compare have copy/paste
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric at boostpro.com
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

By inspecting lexicographical_compare.pass.cpp, I see:

    template <class Iter1, class Iter2>
        int ia[] = {1, 2, 3, 4};
        const unsigned sa = sizeof(ia)/sizeof(ia[0]);
        int ib[] = {1, 2, 3};
        assert(!std::lexicographical_compare(ia, ia+sa, ib, ib+2));
        assert(std::lexicographical_compare(ib, ib+2, ia, ia+sa));
        assert(!std::lexicographical_compare(ia, ia+sa, ib, ib+3));
        assert(std::lexicographical_compare(ib, ib+3, ia, ia+sa));
        assert(std::lexicographical_compare(ia, ia+sa, ib+1, ib+3));
        assert(!std::lexicographical_compare(ib+1, ib+3, ia, ia+sa));

The template parameters Iter1 and Iter2 are unused. This is clearly not what
was intended. The error appears in the other lexicographical_compare tests.

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/20140523/60cfdcc5/attachment.html>

More information about the llvm-bugs mailing list