<div dir="ltr"><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">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><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>