<div dir="ltr">Hi Faisal,<div><br></div><div>I'd prefer putting the TemplateParameterDepthRAII code next to the calls to ActOnReenterTemplateScope (unless there's some reason for them to be separated?). If you increase the depth once for each ActOnReenterTemplateScope call, there shouldn't ever be a need to bump it by more than one. That should also handle the cases of a generic lambda in a default argument in a method or class template, and a generic lambda / local class w/member template in a non-template function in a class template, which I think the current patch won't get right.<br>
<div><br></div><div><div>+  // ok here we need to make sure that the depth of the template parameter list</div><div>+  // of a potential member function template is adjusted for the template</div><div>+  // parameter depth - in case we have local classes with member templates</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Please start comments with a capital letter and end them with a full stop. Also drop the "ok" :)</div><div class="gmail_extra"><br></div><div class="gmail_extra">
<div class="gmail_extra">+  TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);</div><div class="gmail_extra">+  FunctionTemplateDecl *FTD = 0;</div><div class="gmail_extra">+  if (LM.TemplateScope && (FTD = dyn_cast<FunctionTemplateDecl>(LM.D))) {</div>
<div class="gmail_extra">+    TemplateParameterList *TPL = FTD->getTemplateParameters();</div><div class="gmail_extra">+    unsigned MemberTemplateDepth = TPL->getDepth();</div><div class="gmail_extra">+    while( TemplateParameterDepth <= MemberTemplateDepth )</div>
<div class="gmail_extra"><br></div><div class="gmail_extra" style>Space after "while", no spaces immediately inside parens.</div><div class="gmail_extra" style><br></div><div class="gmail_extra">Index: test/CXX/generic-lambdas/fv_print.h<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra" style>Subdirectories inside test/CXX should correspond to sections of the standard. The test itself should be cleaned up prior to commit: remove the printf-based testing mechanism, and don't use lli. If you really want to test CodeGen rather than just Sema (and I think you can avoid that), you should FileCheck the -emit-llvm output. Otherwise, try to craft a -verify test, and put it in test/SemaTemplate.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Thanks!</div><div class="gmail_extra"><br></div><div class="gmail_quote">On Mon, Apr 22, 2013 at 4:40 AM, Faisal Vali <span dir="ltr"><<a href="mailto:faisalv@gmail.com" target="_blank">faisalv@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><div>Hi Doug,<br></div>    I had mentioned this issue to you briefly in Bristol having to do tangentially with generic lambdas: the template parameter depth does not get calculated correctly when local member templates are parsed.  This patch addresses that issue.  I know local member templates are not standard, but some of the machinery I will be using to implement incrementing depth appropriately within generic lambdas is included.  This only addresses the issue of template argument deduction for local member templates - other issues (and i don't remember what they are exactly now - i think you had showed me an example in Portland...) will probably get addressed as the generic lambda implementation moves along (if we care to fix local member templates entirely that is).<br>

<br></div><div>Will refine the patch based on feedback.<br><br></div>Thanks!<span class=""><font color="#888888"><br><div> <br clear="all"><div><div><div>Faisal Vali<br><br></div>
</div></div></div></font></span></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">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></div></div></div>