<div dir="ltr">Hi Reid,<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 8:31 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div 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 class="gmail_extra"><div><br></div><div>Are we stuck here? Or is there a workaround for visiting template bodies even under -fdelayed-template-parsing?</div>
</div></div></blockquote><div><br></div></div><div>Hypothetically you could record every late parsed function decl (FD->isLateTemplateParsed()) and call LateTemplateParser on it at the end of the TU.  This would get you the uninstantiated template AST, which is what you want. I make no guarantees, though. :)</div>
</div></div></div></blockquote><div><br></div><div>This seems to work surprisingly well :-)</div><div><br></div><div>After having run the entire RAV cycle on the translation unit I invoke LateTemplateParser on all collected FunctionDecls. Then I need to RAV all these decls again to collect uses, but it seems to work.</div>
<div><br></div><div>I'm guessing this introduces a risk for double-visiting FunctionDecls that _do_ become instantiated; can I somehow check the FDs before forcefully instantiating them? Not that I think it makes a big difference, it just seems hygienic not to late-parse and revisit stuff that's already been recorded.</div>
<div><br></div><div>Many thanks!</div><div><br></div><div>- Kim</div></div></div></div>