]> granicus.if.org Git - clang/commit
[-Wunreachable-code] Handle idiomatic do...while() with an uninteresting condition.
authorTed Kremenek <kremenek@apple.com>
Thu, 6 Mar 2014 00:17:44 +0000 (00:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 6 Mar 2014 00:17:44 +0000 (00:17 +0000)
commit542df791afd9b958cc3f785ff20d7c861ca97868
tree00e68979c86feb7c1234d182b103e40fe2c2a02e
parentc7d11a8ea54863ae58e84fd1a3be94c3c523c6b2
[-Wunreachable-code] Handle idiomatic do...while() with an uninteresting condition.

Sometimes do..while() is used to create a scope that can be left early.
In such cases, the unreachable 'while()' test is not usually interesting
unless it actually does something that is observable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203036 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ReachableCode.cpp
test/Sema/warn-unreachable.c