[PATCH] D82617: Disable GCC's -Woverloaded-virtual, which has false positives.

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 11:29:47 PDT 2020


Quuxplusone added a comment.

In D82617#2117441 <https://reviews.llvm.org/D82617#2117441>, @sammccall wrote:

> In D82617#2117086 <https://reviews.llvm.org/D82617#2117086>, @Quuxplusone wrote:
>
> > FWIW, I think the example you gave is **correct** for GCC to warn on.
>
>
> Everything the warning says is correct, but in this pattern the polymorphic usage is the whole point of the hierarchy, the subclasses are never exposed. There's no actual danger of confusion.


If you intend for the method to never be called from a subclass, it should be private in that subclass.
This morning I left a comment on https://reviews.llvm.org/D81920#inline-760189 indicating how I would disentangle that code if I owned it. Hopefully that comment clarifies my position somewhat.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82617/new/

https://reviews.llvm.org/D82617





More information about the cfe-commits mailing list