diff --git a/clang/lib/AST/ParentMap.cpp b/clang/lib/AST/ParentMap.cpp index 33731c63ed89..a27b0fd270cb 100644 --- a/clang/lib/AST/ParentMap.cpp +++ b/clang/lib/AST/ParentMap.cpp @@ -66,9 +66,9 @@ bool ParentMap::isConsumedExpr(Expr* E) const { return true; case Stmt::BinaryOperatorClass: { BinaryOperator *BE = cast(P); - // If it is a comma, only the left side is consumed. + // If it is a comma, only the right side is consumed. // If it isn't a comma, both sides are consumed. - return BE->getOpcode()!=BinaryOperator::Comma || DirectChild==BE->getLHS(); + return BE->getOpcode()!=BinaryOperator::Comma ||DirectChild==BE->getRHS(); } case Stmt::ForStmtClass: return DirectChild == cast(P)->getCond();