[cfe-commits] r97815 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/scope-check.c

Chris Lattner sabre at nondot.org
Fri Mar 5 11:26:50 PST 2010


Author: lattner
Date: Fri Mar  5 13:26:49 2010
New Revision: 97815

URL: http://llvm.org/viewvc/llvm-project?rev=97815&view=rev
Log:
address PR6502 by downgrading the scope checker's address
of label error to a warning controllable with a -W flag.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Sema/scope-check.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=97815&r1=97814&r2=97815&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Mar  5 13:26:49 2010
@@ -1589,9 +1589,9 @@
   "illegal switch case into protected scope">;
 def err_indirect_goto_in_protected_scope : Error<
   "illegal indirect goto in protected scope, unknown effect on scopes">;
-def err_addr_of_label_in_protected_scope : Error<
+def err_addr_of_label_in_protected_scope : Warning<
   "address taken of label in protected scope, jump to it would have "
-  "unknown effect on scope">;
+  "unknown effect on scope">, InGroup<DiagGroup<"label-address-scope">>;
 def note_protected_by_variable_init : Note<
   "jump bypasses variable initialization">;
 def note_protected_by_vla_typedef : Note<

Modified: cfe/trunk/test/Sema/scope-check.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/scope-check.c?rev=97815&r1=97814&r2=97815&view=diff
==============================================================================
--- cfe/trunk/test/Sema/scope-check.c (original)
+++ cfe/trunk/test/Sema/scope-check.c Fri Mar  5 13:26:49 2010
@@ -146,7 +146,7 @@
   
   void *Ptrs[] = {
     &&L2,   // Ok.
-    &&L3   // expected-error {{address taken of label in protected scope, jump to it would have unknown effect on scope}}
+    &&L3   // expected-warning {{address taken of label in protected scope, jump to it would have unknown effect on scope}}
   };
 }
 





More information about the cfe-commits mailing list