[patch][pr17624] Consider hidden decls for isUsed checks

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Oct 22 15:00:53 PDT 2013

On 22 October 2013 17:25, Richard Smith <richard at metafoo.co.uk> wrote:
> Patch LGTM.
> I share your concern that we could do with a more comprehensive check for
> similar bugs. That said, in this case, it seems to me that the root cause is
> that a per-Decl 'used' flag doesn't really make much sense in the way we use
> it now. I think we should either track whether that particular declaration
> is used (with isUsed scanning the entire redecl chain), or we should only
> have one flag for the entire redeclaration chain (perhaps by always looking
> at the flag on either the most recent decl or the canonical decl). Modeling
> it as "is this declaration or any previous declaration used" is weird, and
> requires contortions like the loop at the end of
> Sema::MarkFunctionReferenced.

Good point. I will try to implement that.


More information about the cfe-commits mailing list