Skip to content

Commit 8849adc

Browse files
committed
[clang][NFC] Move Diags.isIgnored check later in checkForRedundantLoop
... Iteration.
1 parent 843e362 commit 8849adc

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
@@ -2207,16 +2207,16 @@ namespace {
22072207
// Return when there is nothing to check.
22082208
if (!Body || !Third) return;
22092209

2210-
if (S.Diags.isIgnored(diag::warn_redundant_loop_iteration,
2211-
Third->getBeginLoc()))
2212-
return;
2213-
22142210
// Get the last statement from the loop body.
22152211
CompoundStmt *CS = dyn_cast<CompoundStmt>(Body);
22162212
if (!CS || CS->body_empty()) return;
22172213
Stmt *LastStmt = CS->body_back();
22182214
if (!LastStmt) return;
22192215

2216+
if (S.Diags.isIgnored(diag::warn_redundant_loop_iteration,
2217+
Third->getBeginLoc()))
2218+
return;
2219+
22202220
bool LoopIncrement, LastIncrement;
22212221
DeclRefExpr *LoopDRE, *LastDRE;
22222222

0 commit comments

Comments
 (0)