Copy constructor does not call copy constructors of some members or base classes
This defect occurs when the copy constructor of a class does not call the copy constructor of the following in its initialization list:
One or more of its members.
Its base classes when applicable.
The defect occurs even when a base class constructor is called instead of the base class copy constructor.
The calls to the copy constructors can be done only from the initialization list. If the calls are missing, it is possible that an object is only partially copied.
If the copy constructor of a member is not called, it is possible that the member is not copied.
If the copy constructor of a base class is not called, it is possible that the base class members are not copied.
If you want your copy constructor to perform a complete copy, call the copy constructor of all members and all base classes in its initialization list.
| Group: Object oriented |
| Language: C++ |
| Default: On for handwritten code, off for generated code |
Command-Line Syntax: MISSING_COPY_CTOR_CALL |
| Impact: High |