Enhance -Wuninitialized-experimental diagnostics
to issue the warning at an uninitialized variable's
declaration, but to issue notes at possible
uninitialized uses (which could be multiple).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123994 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/uninit-variables.cpp b/test/SemaCXX/uninit-variables.cpp
index 0d6920c..6d29562 100644
--- a/test/SemaCXX/uninit-variables.cpp
+++ b/test/SemaCXX/uninit-variables.cpp
@@ -33,11 +33,11 @@
return x; // no-warning
}
unsigned test3_c() {
- unsigned x ;
+ unsigned x ; // expected-warning{{use of uninitialized variable 'x'}}
const bool flag = false;
if (flag && (x = test3_aux()) == 0) {
x = 1;
}
- return x; // expected-warning{{use of uninitialized variable 'x'}}
+ return x; // expected-note{{variable 'x' is possibly uninitialized when used here}}
}