<div dir="ltr">While implementing the warning is great (wonder if there's any codebase that isn't -Wunused-using clean, that we could use to compare Clang and GCC's behavior broadly - make sure it's catching the same cases (or justify/investigate differences)) - and using it to motivate the debug info is an improvement to the debug info - it won't quite address all the wasted debug info, unfortunately :/<br><br>Consider this:<br><br>namespace a {<br> struct b;<br>};<div>namespace x {<br> using a::b;<br> inline void f(b*) {<br> }<br>}<br><br>Now the using declaration is used, but if 'f' is never called in this translation unit, it's a bit weird to produce debug info for the using decl and could still substantially bloat debug info. (indeed most of the bloat that the using decl/directive debug info is producing is probably from directives that are used, but not in a way that's relevant to a certain translation unit)<br><br>I've not looked at the change yet, but if it's particularly expensive/complicated to wire up the debug info side, it might not be worth it given it's probably not a significant savings & somewhat of a dead-end compared to what would be needed for a more complete fix. But I guess it's probably not expensive/complicated, so probably some fine low hanging fruit to pick until a more complete fix/improvement is implemented.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 23, 2018 at 8:22 AM Carlos Alberto Enciso via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">CarlosAlbertoEnciso added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D44826#1046671" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44826#1046671</a>, @erichkeane wrote:<br>
<br>
> My opinion matters less than @rsmith or @dblaikie on the review, but it seems to me that Typedef and Using are SO similar that the implementations should just be combined. You'd likely have to change a couple of types along the way to be more generic, but the implementations are essentially a copy/paste of eachother.<br>
<br>
<br>
That is a very valid point and it simplifies quite a lot the patch.<br>
<br>
If the other reviewers do not have any objection, I will combine both implementations and update the uploaded patch.<br>
<br>
Thanks,<br>
Carlos<br>
<br>
<br>
Repository:<br>
rC Clang<br>
<br>
<a href="https://reviews.llvm.org/D44826" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44826</a><br>
<br>
<br>
<br>
</blockquote></div>