<div class="gmail_quote">On Mon, Nov 7, 2011 at 10:14 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
> Appease -Wnon-virtual-dtor<br>
<br>
> +    virtual ~PseudoOpBuilder() {}<br>
> +<br>
<br>
It looks like the right thing to do is to make the dtor protected and<br>
non-virtual (this should still silence the warning), as no users<br>
actually try to destroy these objects polymorphically. (<br>
<a href="http://www.gotw.ca/publications/mill18.htm" target="_blank">http://www.gotw.ca/publications/mill18.htm</a> )<br></blockquote><div><br></div><div>This has come up fairly frequently, and if this technique actually silences the warnings (I thought GCC's warning was... too "clever" for this), I think it would be good to document it in <a href="http://llvm.org/docs/ProgrammersManual.html">http://llvm.org/docs/ProgrammersManual.html</a> or <a href="http://llvm.org/docs/CodingStandards.html">http://llvm.org/docs/CodingStandards.html</a> (whichever seems more appropriate).</div>
</div>