On Fri, Aug 17, 2012 at 3:15 AM, Hans Wennborg <[email protected]> wrote:

> On Thu, Aug 16, 2012 at 9:24 PM, Richard Smith <[email protected]>
> wrote:
> > LGTM, modulo a couple of small things:
>
> Thanks for the review!
>
> >> -  if (!VDecl->hasLocalStorage() &&
> >> -      (isa<InitListExpr>(Init) || !VDecl->getType()->isRecordType()))
> >> -    CheckSelfReference(RealDecl, Init);
> >> +  if (!VDecl->hasLocalStorage() || VDecl->getType()->isReferenceType())
> >> +    if (isa<InitListExpr>(Init) || !VDecl->getType()->isRecordType())
> >> +      CheckSelfReference(RealDecl, Init);
> >
> > '&&' instead of nested 'if's? It might be clearer to reuse
> !isTrackedVar()
> > (from Analysis/UninitializedValues.cpp) here, but I'm happy for the
> patch to
> > go in either way.
>
> Switched to && instead of nested ifs for now.
>
> !isTrackedVar() doesn't seem to be a one-to-one match here. For
> example, in my if statement I'm checking that it's not a record type,
> whereas !isTrackedVar() would check that it's not a scalar or vector
> type. Happy to work with this post-commit if you think it would be
> better, though.
>

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.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to