<div class="gmail_quote">On Tue, Jun 5, 2012 at 2:45 AM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Mon, Jun 4, 2012 at 10:42 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>I mean that we should not consider a class to be completely defined if</div>
it has a pure virtual destructor with no definition in this TU.<br></blockquote><div><br></div></div><div>Done and test added.</div></div></blockquote><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 class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>>> (See clang::DependentFunctionTempateSpecializationInfo for a</div></blockquote></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
>> real-world example of this.) It looks like we won't diagnose that case<br>
>> (because Aligner is technically public, despite being effectively a<br>
>> private member of S). But I suspect we will diagnose this (and<br>
>> probably shouldn't):<br>
>><br>
>> union S {<br>
>>  // ... no use of Aligner ...<br>
>> private:<br>
>>  void *Aligner;<br>
>>  unsigned char Data[8];<br>
>> };<br>
>><br>
>> Perhaps we should conservatively disable the diagnostic for union members?<br>
><br>
><br>
> Why should we not warn in this case? I think in general we might want to<br>
> exempt char-arrays as they are commonly use for alignment, but other than<br>
> that?<br>
<br>
</div>Aligner is 'unused', but has a semantic effect. Note that in the<br>
clang::DependentFunctionTempateSpecializationInfo case, there is no<br>
char array. I'm concerned that a warning for cases like this would<br>
have a high false positive rate. (I have the same concern for padding<br>
members in structs, but I would expect those to generally be public,<br>
since such structs are usually intended to be PODs.)<br></blockquote><div><br></div></div><div>Ah, (things-I-know-about-C++)++. :-)</div><div>I know exclude unions from this analysis. </div><div><br></div><div>New patch attached.</div>
</div>
</blockquote></div><br><div>Thanks! The new patch looks good to me, other than some redundant braces (in particular in IsRecordFullyDefined and CollectFieldInitializer). I'll leave final approval on this to Jordy.</div>