https://llvm.org/bugs/show_bug.cgi?id=28527
Bug ID: 28527 Summary: std::copy() calls memmove on nontrivially-copyable type Product: libc++ Version: 3.8 Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedclangb...@nondot.org Reporter: aa...@aaronballman.com CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com Classification: Unclassified Consider the following snippet: #include <algorithm> int main() { volatile int *v1[100]; volatile int *v2[100]; std::copy(v1, v1 + 100, v2); } This results in a call to memmove() rather than copying individual volatile elements of the array (https://godbolt.org/g/b0fv3R). This should be handled a bit more kindly, since volatile-qualified types are not trivially-copyable types ([basic.types]p9 states in part: "Cv-unqualified scalar types, trivially copyable class types (Clause 9), arrays of such types, and nonvolatile const-qualified versions of these types (3.9.3) are collectively called trivially copyable types."). -- 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