A member function overrides a virtual function of a base class in the file without saying override

tx0/cpp:override-not-markedrecommendedwarningreliability/object-contractsdepth fastbug

What it finds

Without override, a function meant to override that differs in a parameter or in const silently declares a new function, and a later change to the base breaks the override without a compiler error. override makes the compiler check it. The base class must be defined in the file.

From the rule's source, override_not_marked.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:override-not-marked" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:override-not-marked] reason="..."

tx0 explain tx0/cpp:override-not-marked shows the same in the terminal. Found a false positive? Report it.