OPM -- Overriding Private Method
Go Up to C++ Audits
Description
A subclass should not contain a method with the same name and signature as in a superclass if these methods are declared to be private. If this situation is detected, a warning message is generated.
Incorrect
class Window {
void init() {
...
}
};
class Button : public Window {
void init() {
...
}
};
Correct
class Window {
void initWindow() {
...
}
};
class Button : public Window {
void initButton() {
...
}
};
Refactoring
Use the Refactor > Rename refactoring menu command to rename methods.