Fix some issues Daniel pointed out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85526 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index b408a3f..9bf5215 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -184,13 +184,14 @@
bool VisitCharacterLiteral(CharacterLiteral *E) { return false; }
bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) { return false; }
bool VisitArraySubscriptExpr(ArraySubscriptExpr *E)
- { return Visit(E->getLHS()) && Visit(E->getRHS()); }
+ { return Visit(E->getLHS()) || Visit(E->getRHS()); }
bool VisitChooseExpr(ChooseExpr *E)
{ return Visit(E->getChosenSubExpr(Info.Ctx)); }
bool VisitCastExpr(CastExpr *E) { return Visit(E->getSubExpr()); }
bool VisitBinAssign(BinaryOperator *E) { return true; }
bool VisitCompoundAssign(BinaryOperator *E) { return true; }
- bool VisitBinaryOperator(BinaryOperator *E) { return false; }
+ bool VisitBinaryOperator(BinaryOperator *E)
+ { return Visit(E->getLHS()) || Visit(E->getRHS()); }
bool VisitUnaryPreInc(UnaryOperator *E) { return true; }
bool VisitUnaryPostInc(UnaryOperator *E) { return true; }
bool VisitUnaryPreDec(UnaryOperator *E) { return true; }
@@ -198,7 +199,7 @@
bool VisitUnaryDeref(UnaryOperator *E) {
if (E->getType().isVolatileQualified())
return true;
- return false;
+ return Visit(E->getSubExpr());
}
bool VisitUnaryOperator(UnaryOperator *E) { return Visit(E->getSubExpr()); }
};