From: Davide Italiano Date: Thu, 2 Jul 2015 19:20:11 +0000 (+0000) Subject: [Sema] Range-loopify SemaTemplateInstantiateDecl.cpp. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fa1cdcad218527e108fc7c10313a54221b8fd3b;p=clang [Sema] Range-loopify SemaTemplateInstantiateDecl.cpp. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241291 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index e240c70508..aff2d1c966 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2094,14 +2094,13 @@ static void collectUnexpandedParameterPacks( Sema &S, TemplateParameterList *Params, SmallVectorImpl &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(*I)) + if (NonTypeTemplateParmDecl *NTTP = dyn_cast(P)) S.collectUnexpandedParameterPacks(NTTP->getTypeSourceInfo()->getTypeLoc(), Unexpanded); - if (TemplateTemplateParmDecl *TTP = dyn_cast(*I)) + if (TemplateTemplateParmDecl *TTP = dyn_cast(P)) collectUnexpandedParameterPacks(S, TTP->getTemplateParameters(), Unexpanded); } @@ -2731,9 +2730,8 @@ TemplateDeclInstantiator::SubstTemplateParams(TemplateParameterList *L) { typedef SmallVector ParamVector; ParamVector Params; Params.reserve(N); - for (TemplateParameterList::iterator PI = L->begin(), PE = L->end(); - PI != PE; ++PI) { - NamedDecl *D = cast_or_null(Visit(*PI)); + for (auto &P : *L) { + NamedDecl *D = cast_or_null(Visit(P)); Params.push_back(D); Invalid = Invalid || !D || D->isInvalidDecl(); }