<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 23, 2014 at 2:33 PM, Michael Park <span dir="ltr"><<a href="mailto:mcypark@gmail.com" target="_blank">mcypark@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">I tried adding <b>LocalInstantiationScope</b> around <b>PerformPendingInstantiation</b>, like so:<div><br><div><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">// A static constexpr member function of a local class can be used in<br>// a constexpr expression right after the local class' definition.<br>// We need to instantiate them now, otherwise it may be too late.<br>LocalInstantiationScope Local(SemaRef);<br>SemaRef.PerformPendingInstantiations(/*LocalOnly=*/true);<br>Local.Exit();</blockquote><div><br></div>but it didn't seem to work. I'm not sure what I'm missing here. Could you give me a hint please?</div></div></div></blockquote><div><br></div><div>This is the bit I was referring to:</div><div><br></div><div><div>  SavePendingLocalImplicitInstantiationsRAII</div><div>      SavedPendingLocalImplicitInstantiations(*this);</div><div>  std::unique_ptr<SavePendingInstantiationsAndVTableUsesRAII></div><div>      SavePendingInstantiationsAndVTableUses;</div><div>  if (Recursive) {</div><div>    SavePendingInstantiationsAndVTableUses.reset(</div><div>        new SavePendingInstantiationsAndVTableUsesRAII(*this));</div><div>  }</div></div><div><br></div><div>[...]</div><div><br></div><div><div>  PerformPendingInstantiations(/*LocalOnly=*/true);</div><div>  Scope.Exit();</div><div><br></div><div>  if (Recursive) {</div><div>    // Define any pending vtables.</div><div>    DefineUsedVTables();</div><div><br></div><div>    // Instantiate any pending implicit instantiations found during the</div><div>    // instantiation of this template.</div><div>    PerformPendingInstantiations();</div><div><br></div><div>    // Restore PendingInstantiations and VTableUses.</div><div>    SavePendingInstantiationsAndVTableUses.reset();</div><div>  }</div></div><div><br></div><div> </div><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><div>Thanks </div></div></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 25 August 2014 01:30, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</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">It would be better to save and restore the pending local instantiations around the calls to instantiate the class body and its members, as we do elsewhere when we perform local pending instantiations.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 2:41 AM, Michael Park <span dir="ltr"><<a href="mailto:mcypark@gmail.com" target="_blank">mcypark@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">Fixes <a href="http://llvm.org/bugs/show_bug.cgi?id=20625" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=20625</a></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>