]> 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 01:09:45 +0000 (01:09 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 6 Mar 2014 01:09:45 +0000 (01:09 +0000)
commitf09edf7292998f3e93f8026005bc544cb8f34178
treeedbad03dcd3b3edf7fcf918815028daea43e81e6
parentb182cdf142ecce079c19aea8981309237a78202f
[-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@203051 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ReachableCode.cpp
test/Sema/warn-unreachable.c
test/SemaCXX/unreachable-code.cpp