if (AD.Observer)
AD.Observer->ObserveStmt(S, currentBlock, AD, LiveState);
- if (getCFG().isBlkExpr(S))
- LiveState(S, AD) = Dead;
+ if (getCFG().isBlkExpr(S)) {
+ if (Expr *E = dyn_cast<Expr>(S))
+ LiveState(E->IgnoreParens(), AD) = Dead;
+ else
+ LiveState(S, AD) = Dead;
+ }
StmtVisitor<TransferFuncs,void>::Visit(S);
}
}
else {
// For block-level expressions, mark that they are live.
- LiveState(S,AD) = Alive;
+ if (Expr *E = dyn_cast<Expr>(S))
+ LiveState(E->IgnoreParens(), AD) = Alive;
+ else
+ LiveState(S, AD) = Alive;
}
}
return;
assert (getCFG().isBlkExpr(E));
+
+ if (const Expr *Ex = dyn_cast<Expr>(E))
+ E = Ex->IgnoreParens();
LiveState(E, AD) = Alive;
}
return *t; // expected-warning {{null pointer}}
}
+int PR8962_c (int *t) {
+ // If the last element in a StmtExpr was a ParenExpr, it's still live
+ if (({ (t ? (_Bool)0 : (_Bool)1); })) return 0;
+ return *t; // no-warning
+}
+
+int PR8962_d (int *t) {
+ // If the last element in a StmtExpr is an __extension__, it's still live
+ if (({ __extension__(t ? (_Bool)0 : (_Bool)1); })) return 0;
+ return *t; // no-warning
+}
+