Hi,<div><br></div><div>comments inline.<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 9:02 PM, Matthieu Monrocq <span dir="ltr"><<a href="mailto:matthieu.monrocq@gmail.com">matthieu.monrocq@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote">Le 11 janvier 2012 10:11, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> a écrit :<div>
<div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>the attached change is designed to detect and warn about private unused members of C++ classes. It checks whether a class is fully defined in the current translation unit, i.e. all methods are either defined or pure virtual and all friends are defined. Otherwise, the private member could be used by a function defined in another translation unit.</div>


<div><br></div><div>An initializer does not count as "use", if:</div><div>- the member is a primitive type</div><div>- the member is a pointer</div><div>- the initializer does not take any arguments</div><div><br>


</div><div>Kind regards,</div><div>Daniel</div>
<br></blockquote></div></div><div><br>Hello Daniel,<br><br>it sounds like a fairly useful warning :)<br><br>I only have two comments regarding the patch itself:<br><br>> is it necessary to actually have UnusedPrivateFields and (Not)FullyDefinedCXXRecords as members of Sema ?  They could be passed (by reference) to IsRecordFullyDefinedInTranslationUnit which could then be marked `const` (unless I missed something)<br>
</div></div></blockquote><div><br></div><div>I will change that, probably according to Chandler's suggestion (make it static helper function).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>> there is no test case<br></div></div></blockquote><div><br></div><div>Sorry, I forgot to include that in the patch (there actually is a test). I will include it in the next version.</div>
<div><br></div><div>Cheers,</div><div>Daniel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div><br>Nice patch.<span class="HOEnZb"><font color="#888888"><br>
<br>-- Matthieu<br></font></span></div></div>
</blockquote></div><br></div>