]> granicus.if.org Git - clang/commitdiff
address PR6502 by downgrading the scope checker's address
authorChris Lattner <sabre@nondot.org>
Fri, 5 Mar 2010 19:26:49 +0000 (19:26 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 5 Mar 2010 19:26:49 +0000 (19:26 +0000)
of label error to a warning controllable with a -W flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97815 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/Sema/scope-check.c

index 9f77655052eb6297b635a9f088ecdc094eb376b1..01317de1b267826d10504dde764f07decec6729f 100644 (file)
@@ -1589,9 +1589,9 @@ def err_switch_into_protected_scope : Error<
   "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<
index 7d293f2747edf74983c7980d430c178142313e38..1df0186d9027a503e7feb694fc389fafc8581d1a 100644 (file)
@@ -146,7 +146,7 @@ L4:
   
   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}}
   };
 }