Add increment/decrement operators and compound assignment operators to the
uninitialized checkers that did not have them before.
llvm-svn: 218435
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 006a3c4..bf53ae3 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -2382,8 +2382,19 @@
if (!FD->getType()->isReferenceType())
DeclsToRemove.push_back(FD);
+ if (E->isCompoundAssignmentOp()) {
+ HandleValue(E->getLHS());
+ }
+
Inherited::VisitBinaryOperator(E);
}
+
+ void VisitUnaryOperator(UnaryOperator *E) {
+ if (E->isIncrementDecrementOp())
+ HandleValue(E->getSubExpr());
+
+ Inherited::VisitUnaryOperator(E);
+ }
};
// Diagnose value-uses of fields to initialize themselves, e.g.