<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 13, 2015 at 1:33 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><a href="https://root.cern.ch/gitweb?p=root.git;a=blob;f=interpreter/cling/lib/Utils/AST.cpp" target="_blank">https://root.cern.ch/gitweb?p=root.git;a=blob;f=interpreter/cling/lib/Utils/AST.cpp</a><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Does it makes sense to upstream this functionality from cling into clang? <br></div></div></blockquote><div><br></div></span><div>Presumably clang needs to do this in places already (diagnostic messages, etc?)? Have you found any instances of that? Is there existing code doing that work that could be refactored into something reusable (that way it's being actually executed and tested within Clang's many codepaths, which is helpful to avoid bitrot, etc)</div></div></div></div></blockquote><div><br></div><div>To the best of my knowledge, it doesn't exist. Certainly not in diagnostics, which try to reproduce what the user wrote, rather than what they would need to write in general. (In particular, things like template_A<nested_type_0, template_B<nested_type_1>> seem to never have sub-types get fully expanded. I've looked for this in clang, and it is possible I missed something, so happy for any pointers.</div><div><br></div><div>Clang is oriented to reproducing the source code as written, not what one would need to write to access it from a random namespace.</div><div><br></div><div>This is one of several bits of functionality where the comment in my code is: "one would think this is implemented somewhere in clang, but one would be wrong". (Generic fully-qualified lookup being another. Also implemented in cling, but is not very complicated, so not as big of a deal as this.)</div></div></div></div>