r219940 - Switching to range-based for loops; NFC.
Aaron Ballman
aaron at aaronballman.com
Thu Oct 16 10:53:07 PDT 2014
Author: aaronballman
Date: Thu Oct 16 12:53:07 2014
New Revision: 219940
URL: http://llvm.org/viewvc/llvm-project?rev=219940&view=rev
Log:
Switching to range-based for loops; NFC.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=219940&r1=219939&r2=219940&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Oct 16 12:53:07 2014
@@ -11301,19 +11301,14 @@ void Sema::PopExpressionEvaluationContex
// 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);
}
}
}
More information about the cfe-commits
mailing list