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

            Bug ID: 35119
           Summary: std::set_union accesses an element after it has been
                    moved out.
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: denis.yaroshevs...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

std::set_union has this code:

```
*__result = *__first1;

if (!__comp(*__first1, *__first2))
 ++__first2;
```

It's not ok, since the assignment might have moved the value out.

Suggested fix and test: https://reviews.llvm.org/D39405

-- 
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