Revert "[Analysis] -Wunreachable-code shouldn't fire on the increment of a foreach loop"

This reverts commit r354102.

llvm-svn: 354109
This commit is contained in:
Sam McCall 2019-02-15 09:18:49 +00:00
parent 3c17cb7bc4
commit 24f135733d
2 changed files with 0 additions and 9 deletions

View File

@ -631,10 +631,6 @@ void DeadCodeScan::reportDeadCode(const CFGBlock *B,
// a for/for-range loop. This is the block that contains
// the increment code.
if (const Stmt *LoopTarget = B->getLoopTarget()) {
// The increment on a foreach statement is not written.
if (isa<CXXForRangeStmt>(LoopTarget))
return;
SourceLocation Loc = LoopTarget->getBeginLoc();
SourceRange R1(Loc, Loc), R2;

View File

@ -52,11 +52,6 @@ void test3() {
}
}
void test4() {
for (char c : "abc") // no-warning
break;
}
// PR 6130 - Don't warn about bogus unreachable code with throw's and
// temporary objects.
class PR6130 {