[cfe-commits] r124782 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/uninit-variables.c

Ted Kremenek kremenek at apple.com
Wed Feb 2 22:51:51 PST 2011


Author: kremenek
Date: Thu Feb  3 00:51:50 2011
New Revision: 124782

URL: http://llvm.org/viewvc/llvm-project?rev=124782&view=rev
Log:
Reenable -Wuninitialized warning for captured block variables.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Sema/uninit-variables.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=124782&r1=124781&r2=124782&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Feb  3 00:51:50 2011
@@ -840,7 +840,7 @@
   InGroup<Uninitialized>, 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<Uninitialized>, DefaultIgnore;
 def note_var_fixit_add_initialization : Note<

Modified: cfe/trunk/test/Sema/uninit-variables.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/uninit-variables.c?rev=124782&r1=124781&r2=124782&view=diff
==============================================================================
--- cfe/trunk/test/Sema/uninit-variables.c (original)
+++ cfe/trunk/test/Sema/uninit-variables.c Thu Feb  3 00:51:50 2011
@@ -193,8 +193,8 @@
 }
 
 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() {





More information about the cfe-commits mailing list