Incorrect object oriented programming
Dynamic type of this
pointer is incorrect
Description
This check on a class member function call determines if the call is valid.
A member function call can be invalid for the following reasons:
You call the member function through a function pointer that points to the function. However, the data types of the arguments or return values of the function and the function pointer do not match.
You call a pure
virtual
member function from the class constructor or destructor.You call a
virtual
member function through an incorrectthis
pointer. Thethis
pointer stores the address of the object used to call the function. Thethis
pointer can be incorrect because:You obtain an object through a cast from another object. The objects are instances of two unrelated classes.
You perform pointer arithmetic on a pointer pointing to an array of objects. However, the pointer arithmetic causes the pointer to go outside the array bounds. When you dereference the pointer, it is not pointing to a valid object.
Diagnosing This Check
Examples
Check Information
Group: C++ |
Language: C++ |
Acronym: OOP |