In response to some discussions on IRC, tweak the wording of the new
-Wsometimes-uninitialized diagnostics to make it clearer that the cause
of the issue may be a condition which must always evaluate to true or
false, rather than an uninitialized variable.

To emphasize this, add a new note with a fixit which removes the
impossible condition or replaces it with a constant.

Also, downgrade the diagnostic from -Wsometimes-uninitialized to
-Wconditional-uninitialized when it applies to a range-based for loop,
since the condition is not written explicitly in the code in that case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157511 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c
index 1be8da8..ef03d44 100644
--- a/test/Sema/uninit-variables.c
+++ b/test/Sema/uninit-variables.c
@@ -39,9 +39,10 @@
 
 int test7(int y) {
   int x; // expected-note{{initialize the variable 'x' to silence this warning}}
-  if (y) // expected-note{{uninitialized use occurs whenever 'if' condition is false}}
+  if (y) // expected-warning{{variable 'x' is used uninitialized whenever 'if' condition is false}} \
+         // expected-note{{remove the 'if' if its condition is always true}}
     x = 1;
-  return x; // expected-warning{{variable 'x' is sometimes uninitialized when used here}}
+  return x; // expected-note{{uninitialized use occurs here}}
 }
 
 int test7b(int y) {
@@ -294,8 +295,9 @@
 
 int test41(int x) {
   int y; // expected-note{{initialize the variable 'y' to silence this warning}}
-  if (x) y = 1; // expected-note{{uninitialized use occurs whenever 'if' condition is false}}
-  return y; // expected-warning {{variable 'y' is sometimes uninitialized when used here}}
+  if (x) y = 1; // expected-warning{{variable 'y' is used uninitialized whenever 'if' condition is false}} \
+                // expected-note{{remove the 'if' if its condition is always true}}
+  return y; // expected-note{{uninitialized use occurs here}}
 }
 
 void test42() {