Copy assignment operator does not call copy assignment operators of base subobjects
This defect occurs when a derived class copy assignment operator does not call the copy assignment operator of its base class.
If this defect occurs, unless you are initializing the base class data members explicitly in the derived class assignment operator, the operator initializes the members implicitly by using the default constructor of the base class. Therefore, it is possible that the base class data members do not get assigned the right values.
If users of your class expect your assignment operator to perform a complete assignment between two objects, they can face unintended consequences.
Call the base class copy assignment operator from the derived class copy assignment operator.
Even if the base class data members are not private,
and you explicitly initialize the base class data members in the derived
class copy assignment operator, replace this explicit initialization
with a call to the base class copy assignment operator. Otherwise,
determine why you retain the explicit initialization.
| Group: Object oriented |
| Language: C++ |
| Default: On for handwritten code, off for generated code |
Command-Line Syntax: MISSING_BASE_ASSIGN_OP_CALL |
| Impact: High |