GeneralPurpose-MissingOverride

Override of functions is only permitted with keyword override

Required inputs: IR

This rule requires the use of the C++11 override keyword when overriding a method.
Bad code
class A
{
    virtual void foo();
};
class B : public A
{
    void foo(); // ERROR: missing override
};
Good code
class A
{
    virtual void foo();
};
class B : public A
{
    void foo() override;
};
See Also
Rule MisraC++-10.3.2

Possible Messages

Key

Text

Severity

Disabled

missing_override

Override of functions is only permitted with keyword override.

None

False

Options

allow_final

allow_final : bool = True

If set to true, do not report overriding virtual functions declared with final.
 

ignore_destructors

ignore_destructors : bool = True

If set to false, also report destructors. Note that not all compilers support this.