[SERVER-20062] Coverity analysis defect 73597: Unsafe assignment operator Created: 20/Aug/15 Updated: 08/Jan/24 Resolved: 25/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Andy Schwerin |
| Resolution: | Done | Votes: | 0 |
| Labels: | coverity | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
Assignment operator does not check for self-assignment Defect 73597 (STATIC_C)
|
| Comments |
| Comment by Andy Schwerin [ 25/Sep/15 ] |
|
acm and mira.carey@mongodb.com point out that automatically generated move operators don't make no-ops of self move, so this type of coverity warning if taken seriously equates to "write explicit move operators for everything." Further, self move of an object that is not already in the moved-from state is a programming error that, while present in some standard algorithms from some providers, is avoidable by mortal programmers. |