[PATCH] D36527: Implemented P0428R2 - Familiar template syntax for generic lambdas

Faisal Vali via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 25 18:21:54 PDT 2017


faisalv added inline comments.


================
Comment at: lib/AST/ExprCXX.cpp:979
 
+SourceRange LambdaExpr::getExplicitTemplateParameterListRange() const {
+  TemplateParameterList *List = getTemplateParameterList();
----------------
hamzasood wrote:
> faisalv wrote:
> > I think this should return an invalid range if getExplicitCount is 0.
> > might assert that when not 0, langleloc does not equal rangleloc.
> > 
> I think it does return an invalid range in that case. Without explicit template parameters, getLAngleLoc and getRAngleLoc return invalid locations. And a range of invalid locations is an invalid range. But I suppose that could be asserted to make sure.
fyi - Since getGenericLambdaTPL sets the LAngleLoc and RAngleLoc to the introducer range - unless one handles that case spearately- those funcs won't return an invalid loc?  


https://reviews.llvm.org/D36527





More information about the cfe-commits mailing list