<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 3, 2011, at 4:42 AM, Somorjai, Akos wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 13px; font-family: Arial, sans-serif; "><div><div><div>I'm trying to use this warning to check the vtable problem. Here's an example</div>
<div><br>
</div>
<div>In mem.hpp </div>
<div><br>
</div>
<div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #bb2d9d">class</span><span class="Apple-tab-span" style="white-space:pre">
</span>AA {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 37); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"></span></span>// Construction / destruction:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(187, 45, 157); ">protected<span style="color: #000000">:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre"></span>AA ();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 37); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"></span>AA (</span><span style="color: #bb2d9d">const</span><span style="color: #000000">
</span><span style="color: #4e8186">AA</span><span style="color: #000000">&); </span>
// Disabled</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(187, 45, 157); ">public<span style="color: #000000">:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre"></span><span style="color: #bb2d9d">virtual</span> ~AA ();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">};</div>
</div>
<div><br>
</div>
<div>In mem.cpp</div>
<div><br>
</div>
<div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(120, 72, 47); ">#include
<span style="color: #d12c26">"mem.hpp"</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; ">
<br>
</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #4e8186">AA</span>::~AA()</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">{</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">}</div>
</div>
<div><br>
</div>
<div>And I still get the following warning:</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>warning: 'AA' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables,3]</div></div></div></div></blockquote><div><br></div>Which version of Clang are you using? Like I said, this warning was still experimental even a few months ago, and it's gotten a lot of attention on ToT. In particular, this case no longer warns.</div><div><br></div><div>John.</div></body></html>