[cfe-dev] Tidy vs Warnings: missing override

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Fri Aug 10 08:24:20 PDT 2018


Yep, that's the general idea - the bar for Clang warnings has generally
(with some variation) been to have a low false-positive rate (where a
false-positive is "warns the user even though there is no behavioral bug
(or significant risk of confusion from readers of the source code) in the
code") - so a blanket warning on all missing overrides wouldn't meet that
bar - lots of code gets along fine without them. But if the user wrote at
least one 'override' keyword in a class, fair bet they meant to write them
all, so warning in that case seems feasible.

clang-tidy is more stylistic & has a lower bar (one of the reasons for the
different bar is that clang-tidy's warnings don't impact the clang codebase
in both code complexity and performance - which is a reason we can't
implement all the possible warnings in there).

- Dave

On Fri, Aug 10, 2018 at 2:23 AM Jonas Toth via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
>
> I experience the override-warning when it was inconsistent within the
> class (meaning it has been used at least once and some places missed it).
> This measure is probably to not warn on old code bases.
>
> Could this be the case?
>
> Best, Jonas
>
> Am 09.08.2018 um 19:26 schrieb JVApen via cfe-dev:
>
> Hello all,
>
> Today we have discovered a case where we did not have a compiler warning
> for a missing override. To verify, we explicitly enabled the warning with
> the pragma.
>
> While investigating this in the IDE, we noticed that the Visual Assist
> plugin did notice that missing override. As this uses clang-tidy to
> determine this, we were wondering if these differences we noticed are
> intentional. If so, is their any documentation on these differences?
>
> Tnx
>
>
> _______________________________________________
> cfe-dev mailing listcfe-dev at lists.llvm.orghttp://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180810/08480454/attachment.html>


More information about the cfe-dev mailing list