зеркало из https://github.com/microsoft/clang-1.git
Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag. I await any fallout/comments/feedback, although hopefully this will produce no noise for users.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127670 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
76709bf816
Коммит
908c09f64e
|
@ -867,7 +867,7 @@ def note_uninit_reference_member : Note<
|
|||
def warn_field_is_uninit : Warning<"field is uninitialized when used here">,
|
||||
InGroup<Uninitialized>;
|
||||
def warn_uninit_var : Warning<"variable %0 is possibly uninitialized when used here">,
|
||||
InGroup<DiagGroup<"uninitialized-experimental">>, DefaultIgnore;
|
||||
InGroup<Uninitialized>, DefaultIgnore;
|
||||
def warn_maybe_uninit_var :
|
||||
Warning<"variable %0 is possibly uninitialized when used here">,
|
||||
InGroup<UninitializedMaybe>, DefaultIgnore;
|
||||
|
@ -875,7 +875,7 @@ def note_uninit_var_def : Note<
|
|||
"variable %0 is declared here">;
|
||||
def warn_uninit_var_captured_by_block : Warning<
|
||||
"variable %0 is possibly uninitialized when captured by block">,
|
||||
InGroup<DiagGroup<"uninitialized-experimental">>, DefaultIgnore;
|
||||
InGroup<Uninitialized>, DefaultIgnore;
|
||||
def warn_maybe_uninit_var_captured_by_block : Warning<
|
||||
"variable %0 is possibly uninitialized when captured by block">,
|
||||
InGroup<UninitializedMaybe>, DefaultIgnore;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -Wuninitialized-maybe -fsyntax-only -fblocks %s -verify
|
||||
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -Wuninitialized-maybe -fsyntax-only -fblocks %s -verify
|
||||
|
||||
int test1() {
|
||||
int x; // expected-note{{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only %s -verify
|
||||
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -fsyntax-only %s -verify
|
||||
|
||||
int test1_aux(int &x);
|
||||
int test1() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only -fblocks %s -verify
|
||||
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -fsyntax-only -fblocks %s -verify
|
||||
|
||||
// Duplicated from uninit-variables.c.
|
||||
// Test just to ensure the analysis is working.
|
||||
|
|
Загрузка…
Ссылка в новой задаче