aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2010-01-21 17:31:41 +0000
committerMike Stump <mrs@apple.com>2010-01-21 17:31:41 +0000
commit45db90de59f6effb7bd9a55660ca97aa3feadc6c (patch)
treefa498ef7912a6b730eeafed5342864a57c8b474e /lib/Sema/SemaChecking.cpp
parentf20dfbcdaaf96757ea67c94376bdca0bd64db02c (diff)
Improve unreachable code warnings for with respect to compound
assignments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 60134e2aa5..8fdb5ec87e 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -2102,6 +2102,12 @@ static SourceLocation GetUnreachableLoc(CFGBlock &b, SourceRange &R1,
R1 = UO->getSubExpr()->getSourceRange();
return UO->getOperatorLoc();
}
+ case Expr::CompoundAssignOperatorClass: {
+ const CompoundAssignOperator *CAO = cast<CompoundAssignOperator>(S);
+ R1 = CAO->getLHS()->getSourceRange();
+ R2 = CAO->getRHS()->getSourceRange();
+ return CAO->getOperatorLoc();
+ }
case Stmt::CXXTryStmtClass: {
return cast<CXXTryStmt>(S)->getHandler(0)->getCatchLoc();
}