diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-02-15 09:18:49 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-02-15 09:18:49 +0000 |
commit | 24f135733dc6ed7e7a6bdd61b4e677dd23873a5d (patch) | |
tree | 9ad092a64a0688d3d495c2e8a4b52ef179e26c7d | |
parent | 3c17cb7bc430f24ea2be9d62b5c0968f4b9aaac4 (diff) | |
download | bcm5719-llvm-24f135733dc6ed7e7a6bdd61b4e677dd23873a5d.tar.gz bcm5719-llvm-24f135733dc6ed7e7a6bdd61b4e677dd23873a5d.zip |
Revert "[Analysis] -Wunreachable-code shouldn't fire on the increment of a foreach loop"
This reverts commit r354102.
llvm-svn: 354109
-rw-r--r-- | clang/lib/Analysis/ReachableCode.cpp | 4 | ||||
-rw-r--r-- | clang/test/SemaCXX/unreachable-code.cpp | 5 |
2 files changed, 0 insertions, 9 deletions
diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp index 6f1814deb00..cc64efa7f07 100644 --- a/clang/lib/Analysis/ReachableCode.cpp +++ b/clang/lib/Analysis/ReachableCode.cpp @@ -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; diff --git a/clang/test/SemaCXX/unreachable-code.cpp b/clang/test/SemaCXX/unreachable-code.cpp index 61805837dc2..fd006c099e7 100644 --- a/clang/test/SemaCXX/unreachable-code.cpp +++ b/clang/test/SemaCXX/unreachable-code.cpp @@ -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 { |