]> granicus.if.org Git - clang/commitdiff
Fix test to test the right thing.
authorTed Kremenek <kremenek@apple.com>
Thu, 17 Mar 2011 05:34:58 +0000 (05:34 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 17 Mar 2011 05:34:58 +0000 (05:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127803 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/uninit-variables-conditional.cpp

index 1a822853d9488567716aef6a154b264e79322e41..257a9b575f1c76218302493d7802f418bcae6745 100644 (file)
@@ -16,8 +16,8 @@ int init(double *);
 // -Wuninitialized.
 double test() {
   double x; // expected-note {{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}}
-  if (bar() || baz() || Foo() || init(&x)) {
-    return x; // expected-warning {{variable 'x' is possibly uninitialized when used here}}
-  }
-  return 1.0;
+  if (bar() || baz() || Foo() || init(&x))
+    return 1.0;
+
+  return x; // expected-warning {{variable 'x' is possibly uninitialized when used here}}
 }