From ae2144ec3f5d2f589a04adbc71f1756ac2bf1d5b Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 16 Oct 2014 17:53:07 +0000 Subject: [PATCH] Switching to range-based for loops; NFC. llvm-svn: 219940 --- clang/lib/Sema/SemaExpr.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d3190d2af0e3..319e0f4f4f9c 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -11301,19 +11301,14 @@ void Sema::PopExpressionEvaluationContext() { // evaluate [...] a lambda-expression. D = diag::err_lambda_in_constant_expression; } - for (unsigned I = 0, N = Rec.Lambdas.size(); I != N; ++I) - Diag(Rec.Lambdas[I]->getLocStart(), D); + for (const auto *L : Rec.Lambdas) + Diag(L->getLocStart(), D); } else { // Mark the capture expressions odr-used. This was deferred // during lambda expression creation. - for (unsigned I = 0, N = Rec.Lambdas.size(); I != N; ++I) { - LambdaExpr *Lambda = Rec.Lambdas[I]; - for (LambdaExpr::capture_init_iterator - C = Lambda->capture_init_begin(), - CEnd = Lambda->capture_init_end(); - C != CEnd; ++C) { - MarkDeclarationsReferencedInExpr(*C); - } + for (auto *Lambda : Rec.Lambdas) { + for (auto *C : Lambda->capture_inits()) + MarkDeclarationsReferencedInExpr(C); } } }