[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 09:09:55 PDT 2020


riccibruno added a comment.

@rsmith

> I think it's important that we handle this in the near future (though I don't mind if you'd like to submit this patch as-is and deal with this as a follow-on). For a case like:
> 
>   void f(int, int = a++);
>    // ... some time later ...
>    f(a);
> 
> ... a warning that only gives the location of the default argument is not useful. We need to show both locations (and potentially a path through multiple default arguments, I suppose; yuck).

I have modified this patch to maintain a chain of additional source location information as we visit default arguments and/or initializers. Each element in this chain stores the location of where the default argument and/or initializer was used. This chain is then displayed after a warning is emitted.

Does this address your concern?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81003/new/

https://reviews.llvm.org/D81003





More information about the cfe-commits mailing list