diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-05 17:41:31 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-05 17:41:31 +0000 |
commit | b414c4fae51c5792d3074b4b78fc8737b1d8387c (patch) | |
tree | eb5d078d4a9cf987d71eac60188d8cd9b5cff22a /test/Sema/uninit-variables.c | |
parent | 9c1714ba3d668b6519f8211927976d777d716b95 (diff) |
Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:
int x = x;
GCC disables its warnings on this construct as a way of indicating that
the programmer intentionally wants the variable to be uninitialized.
Only the warning on the initializer is turned off in this iteration.
This makes the code a lot more ugly, but starts commenting the
surprising behavior here. This is a WIP, I want to refactor it
substantially for clarity, and to determine whether subsequent warnings
should be suppressed or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128894 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 330444bb5c..ee3e88a49c 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}} + int x = x; // no-warning: signals intended lack of initialization. } // Don't warn in the following example; shows dataflow confluence. |