Objektorientierte Defekte
Defekte im Zusammenhang mit der objektorientierten C++ Programmierung, wie z. B. Probleme beim Klassendesign oder in der Vererbungshierarchie
Diese Defekte stehen im Zusammenhang mit dem objektorientierten Aspekt der C++ Programmierung. Die Defekte weisen auf Probleme beim Klassendesign oder in der Vererbungshierarchie hin. Zu diesen Defekten gehören:
Datenelement nicht initialisiert oder im Konstruktor falsch initialisiert
Fälschliches Überschreiben von Methoden der Basisklasse
Verletzung der Datenkapselung
Polyspace-Ergebnisse
*this not returned in copy assignment operator | operator= method does not return a
pointer to the current object |
Base class assignment operator not called | Copy assignment operator does not call copy assignment operators of base subobjects |
Base class destructor not virtual | Class cannot behave polymorphically for deletion of derived class objects |
Bytewise operations on nontrivial class object | Value representations may be improperly initialized or compared |
Conversion or deletion of incomplete class pointer | You delete or cast to a pointer to an incomplete class |
Copy constructor or assignment operator modifying source operand | Copy operation modifies data member of source object |
Copy constructor not called in initialization list | Copy constructor does not call copy constructors of some members or base classes |
Incompatible types prevent overriding | Derived class method hides a virtual base
class method instead of overriding it |
Lambda used as typeid operand | typeid is used on lambda expression |
Member not initialized in constructor | Constructor does not initialize some members of a class |
Missing explicit keyword | Constructor or user-defined conversion operator missing the explicit
specifier |
Missing virtual inheritance | A base class is inherited virtually and nonvirtually in the same hierarchy |
Object slicing | Derived class object passed by value to function with base class parameter |
Operator new not overloaded for possibly overaligned class | Allocated storage might be smaller than object alignment requirement |
Partial override of overloaded virtual functions | Class overrides fraction of inherited virtual functions with a given name |
Return of non const handle to encapsulated data member | Method returns pointer or reference to internal member of object |
Self assignment not tested in operator | Copy assignment operator does not test for self-assignment |
Themen
- Bug Finder Defect Groups
The Bug Finder defect checkers are classified into groups such as data flow, concurrency, numerical, and so on.