mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 12:39:19 +00:00
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:
parent
3c17cb7bc4
commit
24f135733d
@ -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;
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user