From: Ted Kremenek Date: Thu, 3 Feb 2011 06:51:50 +0000 (+0000) Subject: Reenable -Wuninitialized warning for captured block variables. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=553304523bcce281aa3b1afe0f84ae34a90a3c86;p=clang Reenable -Wuninitialized warning for captured block variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124782 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 7bf12f26ec..17fb942fc8 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -840,7 +840,7 @@ def warn_uninit_var : Warning<"variable %0 is possibly uninitialized when used h InGroup, DefaultIgnore; def note_uninit_var_def : Note< "variable %0 is declared here">; -def warn_uninit_var_captured_by_block : Note< +def warn_uninit_var_captured_by_block : Warning< "variable %0 is possibly uninitialized when captured by block">, InGroup, DefaultIgnore; def note_var_fixit_add_initialization : Note< diff --git a/test/Sema/uninit-variables.c b/test/Sema/uninit-variables.c index ce3f93d590..1a080299aa 100644 --- a/test/Sema/uninit-variables.c +++ b/test/Sema/uninit-variables.c @@ -193,8 +193,8 @@ int test28() { } void test29() { - int x; - (void) ^{ (void) x; }; + int x; // expected-note{{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}} + (void) ^{ (void) x; }; // expected-warning{{variable 'x' is possibly uninitialized when captured by block}} } void test30() {