<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 25, 2016 at 1:04 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"><span class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 22, 2016 at 1:58 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<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"><div>This seems like a fragile thing to rely on. What about template instantiation performed at end of TU? (I /think/ that case is currently fine because all the kinds of template we instantiate ultimately do result in a call to HandleTopLevelDecl or some other ASTConsumer callback, but I don't really like relying on that.)</div><div><br></div><div>Could we trigger processing of any remaining deferred declarations in HandleTranslationUnit?<br></div></div></div></div>
</blockquote></div><br></div></span><div class="gmail_extra">We could, but we already have this assert in the destructor:</div><div class="gmail_extra"><div class="gmail_extra">      // There should normally not be any leftover inline method definitions.</div><div class="gmail_extra">      assert(DeferredInlineMethodDefinitions.empty() ||</div><div class="gmail_extra">             Diags.hasErrorOccurred());</div><div><br></div><div>If we ever break the invariant that HandleTopLevelDecl will be called some time after deferring a decl, we will find out about it eventually.</div></div></div>
</blockquote></div><br></div><div class="gmail_extra">OK. This seems like a fairly arbitrary thing to have in the ASTConsumer contract, but in practice it does seem like it ought to hold.</div></div>