Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
are ParenExpr or CastExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71026 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ParentMap.cpp b/lib/AST/ParentMap.cpp
index a27b0fd..939e6f9 100644
--- a/lib/AST/ParentMap.cpp
+++ b/lib/AST/ParentMap.cpp
@@ -51,7 +51,7 @@
Stmt *DirectChild = E;
// Ignore parents that are parentheses or casts.
- while (P && (isa<ParenExpr>(E) || isa<CastExpr>(E))) {
+ while (P && (isa<ParenExpr>(P) || isa<CastExpr>(P))) {
DirectChild = P;
P = getParent(P);
}