[Sema] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Differential Revision: https://reviews.llvm.org/D71529
This commit is contained in:
Mark de Wever 2019-12-17 21:54:32 +01:00
parent 385339034f
commit 3ec6128dae
2 changed files with 2 additions and 2 deletions

View File

@ -1174,7 +1174,7 @@ namespace {
// We analyze lambda bodies separately. Skip them here.
bool TraverseLambdaExpr(LambdaExpr *LE) {
// Traverse the captures, but not the body.
for (const auto &C : zip(LE->captures(), LE->capture_inits()))
for (const auto C : zip(LE->captures(), LE->capture_inits()))
TraverseLambdaCapture(LE, &std::get<0>(C), std::get<1>(C));
return true;
}

View File

@ -1309,7 +1309,7 @@ void ResultBuilder::AddResult(Result R, DeclContext *CurContext,
/// Motivating case is const_iterator begin() const vs iterator begin().
auto &OverloadSet = OverloadMap[std::make_pair(
CurContext, Method->getDeclName().getAsOpaqueInteger())];
for (const DeclIndexPair& Entry : OverloadSet) {
for (const DeclIndexPair Entry : OverloadSet) {
Result &Incumbent = Results[Entry.second];
switch (compareOverloads(*Method,
*cast<CXXMethodDecl>(Incumbent.Declaration),