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

            Bug ID: 36850
           Summary: std::copy_n requires non-overlapping inputs
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: t.p.northo...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Created attachment 20096
  --> https://bugs.llvm.org/attachment.cgi?id=20096&action=edit
Example of unexpected behaviour

Most of the "std::copy*" functions explicitly require their input and output
iterators not to overlap, but std::copy_n doesn't seem to.

However, the implementation of std::copy_n in libc++ forwards to a version of
std::copy which behaves differently than expected from a straightforward
reading of copy_n's effects clause and calls memmove.

This came up on IRC, where Eelis came up with the attached C++ file
demonstrating the difference from a naive copy_n.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to