diff options
author | Mike Stump <mrs@apple.com> | 2010-01-21 19:51:34 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2010-01-21 19:51:34 +0000 |
commit | 44582300b63ac128989643adcd12b6349b67abe4 (patch) | |
tree | 94bedf3ceefa7ae12f7b38aeb2f568202a417971 /lib/Sema/SemaChecking.cpp | |
parent | e5fba7058ce34cc3d75e16e777ec6fc8096183f8 (diff) |
Improve unreachable code warnings for with respect to c-style casts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 9fadd45fbb..018132c368 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -2116,6 +2116,11 @@ static SourceLocation GetUnreachableLoc(CFGBlock &b, SourceRange &R1, const ConditionalOperator *CO = cast<ConditionalOperator>(S); return CO->getQuestionLoc(); } + case Expr::CStyleCastExprClass: { + const CStyleCastExpr *CSC = cast<CStyleCastExpr>(S); + R1 = CSC->getSubExpr()->getSourceRange(); + return CSC->getLParenLoc(); + } case Expr::ImplicitCastExprClass: ++sn; goto top; |