diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-04-04 23:29:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-04-04 23:29:12 +0000 |
commit | d40066b0fb883839a9100e5455e33190b9b8abac (patch) | |
tree | 124f08f735101c427e0c9a852b248584814c7022 /test/Sema/uninit-variables.c | |
parent | ab868e2b409e73516dd83c44e1a32c122c460757 (diff) |
Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:
1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.
The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/uninit-variables.c')
-rw-r--r-- | test/Sema/uninit-variables.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c index e0558ccc78..330444bb5c 100644 --- a/test/Sema/uninit-variables.c +++ b/test/Sema/uninit-variables.c @@ -92,7 +92,7 @@ void test14() { } void test15() { - int x = x; // expected-warning{{variable 'x' is uninitialized when used within its own initialization}} expected-note{{variable 'x' is declared here}} + int x = x; // expected-warning{{variable 'x' is uninitialized when used within its own initialization}} } // Don't warn in the following example; shows dataflow confluence. |