faisalv added inline comments.
================
Comment at: lib/AST/ExprCXX.cpp:979
+SourceRange LambdaExpr::getExplicitTemplateParameterListRange() const {
+ TemplateParameterList *List = getTemplateParameterList();
----------------
I think this should return an invalid range if getExplicitCount is 0.
might assert that when not 0, langleloc does not equal rangleloc.
================
Comment at: lib/Sema/SemaLambda.cpp:486
+ && "Already acted on explicit template parameters");
+ assert(LSI->TemplateParams.size() == 0
+ && "Explicit template parameters should come "
----------------
Perhaps also assert TParams.size should not be 0?
================
Comment at: lib/Sema/SemaLambda.cpp:495
+ reinterpret_cast<NamedDecl *const *>(TParams.begin()),
+ reinterpret_cast<NamedDecl *const *>(TParams.end()));
+ LSI->NumExplicitTemplateParams = TParams.size();
----------------
ack - avoid reinterpret cast please - why not just stick to Decl* for
TemplateParams for now - and add some fixme's that suggest we should consider
refactoring ParseTemplateParameterList to accept a vector of nameddecls - and
update this when that gets updated ?
Perhaps add an assert here that iterates through and checks to make sure each
item in this list is some form of a template parameter decl - within an #ifndef
NDEBUG block (or your conversion check to NameDecl should suffice?)
https://reviews.llvm.org/D36527
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits