Ehsan Akhgari writes:

> I think there's a typo of some sort in the question, but if you
> meant "every overriding function must be marked with override",
> then yes, that is the change I'm proposing, but the good news is
> that you can now run clang-tidy on the entire tree and get it to
> rewrite the source code to make sure that the override keywords
> are present where they are needed, and we can do that as often as
> we would like.  IOW, this can be done without requiring every C++
> programmer to remember to do it always.

I fear that an automatic update would be more than just enforcing
a style because override keywords imply programmer intent.

If the proposal is to periodically automatically add override
keywords where methods override but are currently not annotated as
such, then it seems we should we have an annotation to indicate
that a method is not intended to override.

However, that would require annotating all methods.

This seems similar to the compiler warning situation.
Usually at least, I don't think we should automatically modify the
code in line with how the compiler reads the code just to silence
the warning.  Instead the warning is there to indicate that a
programmer needs to check the code.

Perhaps though there is a case for a one-off change to add
override automatically so that warnings can be enabled on new
code.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to