diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-04-07 20:02:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-04-07 20:02:56 +0000 |
commit | a21612f95792c1ea8b4362f0861f0c724c39388e (patch) | |
tree | 1bb2be038041e61b0c5052a62981b46f9ecabf25 /test/SemaCXX/uninit-variables.cpp | |
parent | f275150eff0583b075a460f59f1883e68ab6dbd4 (diff) |
Teach -Wuninitialized to not warn about variables declared in C++ catch statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/uninit-variables.cpp')
-rw-r--r-- | test/SemaCXX/uninit-variables.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaCXX/uninit-variables.cpp b/test/SemaCXX/uninit-variables.cpp index 6fa59fe2a1..777734c825 100644 --- a/test/SemaCXX/uninit-variables.cpp +++ b/test/SemaCXX/uninit-variables.cpp @@ -78,3 +78,17 @@ void PR9625() { (void)static_cast<float>(x); // no-warning } } + +// Don't warn about variables declared in "catch" +void RDar9251392_bar(const char *msg); + +void RDar9251392() { + try { + throw "hi"; + } + catch (const char* msg) { + RDar9251392_bar(msg); // no-warning + } +} + + |