diff options
| -rw-r--r-- | clang/lib/AST/ParentMap.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/ParentMap.cpp b/clang/lib/AST/ParentMap.cpp index 877b43b6de9..33731c63ed8 100644 --- a/clang/lib/AST/ParentMap.cpp +++ b/clang/lib/AST/ParentMap.cpp @@ -66,7 +66,9 @@ bool ParentMap::isConsumedExpr(Expr* E) const { return true; case Stmt::BinaryOperatorClass: { BinaryOperator *BE = cast<BinaryOperator>(P); - return BE->getOpcode()==BinaryOperator::Comma && DirectChild==BE->getLHS(); + // If it is a comma, only the left side is consumed. + // If it isn't a comma, both sides are consumed. + return BE->getOpcode()!=BinaryOperator::Comma || DirectChild==BE->getLHS(); } case Stmt::ForStmtClass: return DirectChild == cast<ForStmt>(P)->getCond(); |

