]> granicus.if.org Git - clang/commitdiff
Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
authorTed Kremenek <kremenek@apple.com>
Tue, 5 May 2009 22:16:12 +0000 (22:16 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 5 May 2009 22:16:12 +0000 (22:16 +0000)
are ParenExpr or CastExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71026 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ParentMap.cpp

index a27b0fd270cbcc99102780d8f7336fb77a105282..939e6f9be529ca2e5b07b1192bee6179610eb607 100644 (file)
@@ -51,7 +51,7 @@ bool ParentMap::isConsumedExpr(Expr* E) const {
   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);
   }