<div class="gmail_quote">On Fri, Aug 17, 2012 at 3:15 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="im">On Thu, Aug 16, 2012 at 9:24 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> LGTM, modulo a couple of small things:<br>
<br>
</div>Thanks for the review!<br>
<div class="im"><br>
>> -  if (!VDecl->hasLocalStorage() &&<br>
>> -      (isa<InitListExpr>(Init) || !VDecl->getType()->isRecordType()))<br>
>> -    CheckSelfReference(RealDecl, Init);<br>
>> +  if (!VDecl->hasLocalStorage() || VDecl->getType()->isReferenceType())<br>
>> +    if (isa<InitListExpr>(Init) || !VDecl->getType()->isRecordType())<br>
>> +      CheckSelfReference(RealDecl, Init);<br>
><br>
> '&&' instead of nested 'if's? It might be clearer to reuse !isTrackedVar()<br>
> (from Analysis/UninitializedValues.cpp) here, but I'm happy for the patch to<br>
> go in either way.<br>
<br>
</div>Switched to && instead of nested ifs for now.<br>
<br>
!isTrackedVar() doesn't seem to be a one-to-one match here. For<br>
example, in my if statement I'm checking that it's not a record type,<br>
whereas !isTrackedVar() would check that it's not a scalar or vector<br>
type. Happy to work with this post-commit if you think it would be<br>
better, though.<br></blockquote><div><br></div><div>Yeah, isTrackedVar() only corresponds (approximately) to the LHS of your &&. The RHS is dealing with this check also being performed in SemaInit for non-InitListExpr record initializations.</div>
</div>