Bug 455 - Copy assignment operators without check against self-assignment
Copy assignment operators without check against self-assignment
Status: NEW
Product: AspectC++
Classification: Unclassified
Component: Parser-Puma
unspecified
All All
: P2 normal
Assigned To: Matthias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-31 10:40 CET by Markus Elfring
Modified: 2011-10-31 10:40 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Elfring 2011-10-31 10:40:42 CET
I have found a few source files for classes which contain custom copy assignment
operators.

Examples:
- List.cc
- MatchName.cc
- PointCut.cc

I wonder why checks against self-assignment were omitted.

https://www.securecoding.cert.org/confluence/display/cplusplus/MEM42-CPP.+Ensure+that+copy+assignment+operators+do+not+damage+an+object+that+is+copied+to+itself
http://dietmar-kuehl.de/mirror/c++-faq/assignment-operators.html#faq-12.3