[analyzer] Ignore parentheses around block-level expressions when computing liveness. Fixes the other half of PR8962.
llvm-svn: 132769
diff --git a/clang/test/Analysis/misc-ps.c b/clang/test/Analysis/misc-ps.c
index 0729ce2..84992c6 100644
--- a/clang/test/Analysis/misc-ps.c
+++ b/clang/test/Analysis/misc-ps.c
@@ -50,3 +50,15 @@
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
+}
+