[cfe-commits] r127803 - /cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp

Ted Kremenek kremenek at apple.com
Wed Mar 16 22:34:58 PDT 2011


Author: kremenek
Date: Thu Mar 17 00:34:58 2011
New Revision: 127803

URL: http://llvm.org/viewvc/llvm-project?rev=127803&view=rev
Log:
Fix test to test the right thing.

Modified:
    cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp

Modified: cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp?rev=127803&r1=127802&r2=127803&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp (original)
+++ cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp Thu Mar 17 00:34:58 2011
@@ -16,8 +16,8 @@
 // -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}}
 }





More information about the cfe-commits mailing list