Hi Richard, let me know what you think of this patch to address the template parameter depth tracking issue. thanks!
Faisal Vali On Mon, Apr 22, 2013 at 8:01 AM, Richard Smith <[email protected]>wrote: > Hi Faisal, > > 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. > > + // ok here we need to make sure that the depth of the template > parameter list > + // of a potential member function template is adjusted for the template > + // parameter depth - in case we have local classes with member templates > > Please start comments with a capital letter and end them with a full stop. > Also drop the "ok" :) > > + TemplateParameterDepthRAII > CurTemplateDepthTracker(TemplateParameterDepth); > + FunctionTemplateDecl *FTD = 0; > + if (LM.TemplateScope && (FTD = dyn_cast<FunctionTemplateDecl>(LM.D))) { > + TemplateParameterList *TPL = FTD->getTemplateParameters(); > + unsigned MemberTemplateDepth = TPL->getDepth(); > + while( TemplateParameterDepth <= MemberTemplateDepth ) > > Space after "while", no spaces immediately inside parens. > > Index: test/CXX/generic-lambdas/fv_print.h > > 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. > > Thanks! > > On Mon, Apr 22, 2013 at 4:40 AM, Faisal Vali <[email protected]> wrote: > >> Hi Doug, >> 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). >> >> Will refine the patch based on feedback. >> >> Thanks! >> >> Faisal Vali >> >> >> _______________________________________________ >> cfe-commits mailing list >> [email protected] >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >> >> >
interim-2-with-depth-working+assertions.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
