summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-03-22 05:57:43 +0000
committerTed Kremenek <kremenek@apple.com>2012-03-22 05:57:43 +0000
commit550f2234fc9218914c325041067052342dfce553 (patch)
tree5d84efc1c581f31ab583cff96013c6f53fe632f4 /test/SemaCXX
parent564f4c5664f552becbd05407611a92754c40e641 (diff)
Fix broken CFG when an initializer is a statement expression that starts with a while loop (PR 12325).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r--test/SemaCXX/uninitialized.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/uninitialized.cpp b/test/SemaCXX/uninitialized.cpp
index 9550682918..15c06eb421 100644
--- a/test/SemaCXX/uninitialized.cpp
+++ b/test/SemaCXX/uninitialized.cpp
@@ -147,3 +147,18 @@ namespace rdar10398199 {
(void)y;
};
}
+
+// PR 12325 - this was a false uninitialized value warning due to
+// a broken CFG.
+int pr12325(int params) {
+ int x = ({
+ while (false)
+ ;
+ int _v = params;
+ if (false)
+ ;
+ _v; // no-warning
+ });
+ return x;
+}
+