Sema &S,
TemplateParameterList *Params,
SmallVectorImpl<UnexpandedParameterPack> &Unexpanded) {
- for (TemplateParameterList::const_iterator I = Params->begin(),
- E = Params->end(); I != E; ++I) {
- if ((*I)->isTemplateParameterPack())
+ for (const auto &P : *Params) {
+ if (P->isTemplateParameterPack())
continue;
- if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(*I))
+ if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(P))
S.collectUnexpandedParameterPacks(NTTP->getTypeSourceInfo()->getTypeLoc(),
Unexpanded);
- if (TemplateTemplateParmDecl *TTP = dyn_cast<TemplateTemplateParmDecl>(*I))
+ if (TemplateTemplateParmDecl *TTP = dyn_cast<TemplateTemplateParmDecl>(P))
collectUnexpandedParameterPacks(S, TTP->getTemplateParameters(),
Unexpanded);
}
typedef SmallVector<NamedDecl *, 8> ParamVector;
ParamVector Params;
Params.reserve(N);
- for (TemplateParameterList::iterator PI = L->begin(), PE = L->end();
- PI != PE; ++PI) {
- NamedDecl *D = cast_or_null<NamedDecl>(Visit(*PI));
+ for (auto &P : *L) {
+ NamedDecl *D = cast_or_null<NamedDecl>(Visit(P));
Params.push_back(D);
Invalid = Invalid || !D || D->isInvalidDecl();
}