aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/uninit-variables.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-04 20:30:58 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-04 20:30:58 +0000
commitf8adeefa9e9882bff402e092024dd457f8574673 (patch)
tree3058605ba5d49ddc2ce05a2db7411faa5690001f /test/SemaCXX/uninit-variables.cpp
parent5360c921a91dc43b442f069ba86d7b9df66362fc (diff)
-Wuninitialized: don't warn about uninitialized variables in unreachable code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/uninit-variables.cpp')
-rw-r--r--test/SemaCXX/uninit-variables.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/uninit-variables.cpp b/test/SemaCXX/uninit-variables.cpp
index 77cbcf72a3..6fa59fe2a1 100644
--- a/test/SemaCXX/uninit-variables.cpp
+++ b/test/SemaCXX/uninit-variables.cpp
@@ -70,3 +70,11 @@ class Rdar9188004C : public Rdar9188004B<Rdar9188004A> {
virtual void bar(void) const;
};
void Rdar9188004C::bar(void) const {}
+
+// Don't warn about uninitialized variables in unreachable code.
+void PR9625() {
+ if (false) {
+ int x;
+ (void)static_cast<float>(x); // no-warning
+ }
+}