diff options
author | Richard Trieu <rtrieu@google.com> | 2014-09-25 01:15:40 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-09-25 01:15:40 +0000 |
commit | 702863c43da79c158db2162a9ba5901797050aea (patch) | |
tree | 17bd08fccce3b168b8252b2fe4e26fecfa31c8b0 /lib/Sema/SemaDecl.cpp | |
parent | 7a0ca9263dbfeaad11ae68a64056c3d31a6cf56d (diff) |
Add increment/decrement operators and compound assignment operators to the
uninitialized checkers that did not have them before.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 277816be42..1bac28753f 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -8452,6 +8452,12 @@ namespace { HandleValue(E->getSubExpr()); return; } + + if (E->isIncrementDecrementOp()) { + HandleValue(E->getSubExpr()); + return; + } + Inherited::VisitUnaryOperator(E); } @@ -8480,6 +8486,16 @@ namespace { Inherited::VisitCallExpr(E); } + void VisitBinaryOperator(BinaryOperator *E) { + if (E->isCompoundAssignmentOp()) { + HandleValue(E->getLHS()); + Visit(E->getRHS()); + return; + } + + Inherited::VisitBinaryOperator(E); + } + // A custom visitor for BinaryConditionalOperator is needed because the // regular visitor would check the condition and true expression separately // but both point to the same place giving duplicate diagnostics. |