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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D81003: [clang] Sequen... Bruno Ricci via Phabricator via cfe-commits

Reply via email to