Skip to content

Commit 8cd17bb

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ccb6b0dafda2' from llvm.org/main into next
2 parents 8a8fee1 + ccb6b0d commit 8cd17bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/Sema/SemaStmt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,16 +2224,16 @@ namespace {
22242224
// Return when there is nothing to check.
22252225
if (!Body || !Third) return;
22262226

2227-
if (S.Diags.isIgnored(diag::warn_redundant_loop_iteration,
2228-
Third->getBeginLoc()))
2229-
return;
2230-
22312227
// Get the last statement from the loop body.
22322228
CompoundStmt *CS = dyn_cast<CompoundStmt>(Body);
22332229
if (!CS || CS->body_empty()) return;
22342230
Stmt *LastStmt = CS->body_back();
22352231
if (!LastStmt) return;
22362232

2233+
if (S.Diags.isIgnored(diag::warn_redundant_loop_iteration,
2234+
Third->getBeginLoc()))
2235+
return;
2236+
22372237
bool LoopIncrement, LastIncrement;
22382238
DeclRefExpr *LoopDRE, *LastDRE;
22392239

0 commit comments

Comments
 (0)