<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 9:52 AM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Sep 15, 2014 at 12:33 PM, Frédéric Riss <<a href="mailto:friss@apple.com">friss@apple.com</a>> wrote:<br>
><br>
> On 15 Sep 2014, at 20:19, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Mon, Sep 15, 2014 at 3:38 AM, Frederic Riss <<a href="mailto:friss@apple.com">friss@apple.com</a>> wrote:<br>
>><br>
>> Author: friss<br>
>> Date: Mon Sep 15 05:38:13 2014<br>
>> New Revision: 217756<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217756&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=217756&view=rev</a><br>
>> Log:<br>
>> Fix a non-virtual destructor warning introduced in r217747.<br>
>><br>
>> Modified:<br>
>>     llvm/trunk/lib/DebugInfo/DWARFUnit.h<br>
>><br>
>> Modified: llvm/trunk/lib/DebugInfo/DWARFUnit.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFUnit.h?rev=217756&r1=217755&r2=217756&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFUnit.h?rev=217756&r1=217755&r2=217756&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/DebugInfo/DWARFUnit.h (original)<br>
>> +++ llvm/trunk/lib/DebugInfo/DWARFUnit.h Mon Sep 15 05:38:13 2014<br>
>> @@ -35,6 +35,8 @@ public:<br>
>>    /// Returns the Unit that contains the given section offset in the<br>
>>    /// same section this Unit originated from.<br>
>>    virtual DWARFUnit *getUnitForOffset(uint32_t Offset) const = 0;<br>
>> +<br>
>> +  virtual ~DWARFUnitSectionBase() {}<br>
><br>
><br>
> Since these objects are never polymorphically owned, a better fix for this<br>
> would be to make the base dtor protected, and the derived classes final.<br>
> That will satisfy the warning without adding an unneeded vtable<br>
> entry/virtual call overhead.<br>
><br>
><br>
> I’ll do that in a followup commit tomorrow.<br>
<br>
</div></div>This is causing problems for me after r217871:<br>
<br>
In file included from<br>
third_party/llvm/llvm/lib/DebugInfo/DWARFCompileUnit.h:13:0,<br>
                 from<br>
third_party/llvm/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp:11:<br>
third_party/llvm/llvm/lib/DebugInfo/DWARFUnit.h: In instantiation of<br>
'class llvm::DWARFUnitSection<llvm::DWARFCompileUnit>':<br>
third_party/llvm/llvm/lib/DebugInfo/DWARFContext.h:32:38:   required from here<br>
third_party/llvm/llvm/lib/DebugInfo/DWARFUnit.h:45:7: error: 'class<br>
llvm::DWARFUnitSection<llvm::DWARFCompileUnit>' has virtual functions<br>
and accessible non-virtual destructor [-Werror=non-virtual-dtor]<br></blockquote><div><br></div><div>Which build system & compiler (version/revision) are you using?<br><br>I was pretty sure we already have cases of this sort of code that should be warning if this was a problem... (we added checking in the build config (maybe only in cmake? not sure) to disable the warning unless it had the right behavior here)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
 - Hans<br>
</font></span></blockquote></div><br></div></div>