[llvm] 588ffda - [polly] Fix compiler warning. NFC.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 13:34:50 PDT 2022


On Tue, May 17, 2022 at 1:18 PM Michael Kruse
<MichaelKruse at meinersbur.de> wrote:
>
> Am Di., 17. Mai 2022 um 12:56 Uhr schrieb David Blaikie <dblaikie at gmail.com>:
> > Could the dtor be non-virtual but protected in DOTGraphTraits* (if
> > these types are not instantiated directly) and then the derived
> > classes marked as final? Just a thought, if the virtual destruction
> > isn't actually needed, that's one way to express the API intent more
> > accurately than adding an unneeded virtual.
>
> That actually does avoid the warning, although I do not understand why
> it is not necessary to redeclare a public dtor in all the derived
> classes. Is the implicit one always public?

It's implicitly always public, yeah. Destructors aren't /exactly/
inherited (same as constructors) - the derived classes get their own
destructors following the usual rules and those destructors /call/ the
base class destructor (which they can do, since they are protected and
derived classes have access to the protected members of their base
subobjects).

Thanks!

>
> Review here: reviews.llvm.org/D125830
>
> Michael
>
> --
> Tardyzentrismus verboten!


More information about the llvm-commits mailing list