diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-10-16 17:53:07 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-10-16 17:53:07 +0000 |
commit | 7fc72f622462e5e8803c12d7b8fb04ee1df1b919 (patch) | |
tree | 4f1076f5517eb727999dd8b37340293faccca9d8 /lib/Sema/SemaExpr.cpp | |
parent | 44a6862f15e4e0c540b93918e0caff47792f1709 (diff) |
Switching to range-based for loops; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d3190d2af0..319e0f4f4f 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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); } } } |