diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-03-22 05:57:43 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-03-22 05:57:43 +0000 |
commit | 550f2234fc9218914c325041067052342dfce553 (patch) | |
tree | 5d84efc1c581f31ab583cff96013c6f53fe632f4 /test/SemaCXX | |
parent | 564f4c5664f552becbd05407611a92754c40e641 (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.cpp | 15 |
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; +} + |