]> granicus.if.org Git - clang/commitdiff
Emit warning on indirect goto that potentially violates
authorChris Lattner <sabre@nondot.org>
Fri, 5 Mar 2010 20:38:02 +0000 (20:38 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 5 Mar 2010 20:38:02 +0000 (20:38 +0000)
scope instead of error, PR6517

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

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

index 01317de1b267826d10504dde764f07decec6729f..badd64c31b56ba9e25b7ad92734a58835299caec 100644 (file)
@@ -1587,8 +1587,9 @@ def err_undeclared_label_use : Error<"use of undeclared label '%0'">;
 def err_goto_into_protected_scope : Error<"illegal goto into protected scope">;
 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_indirect_goto_in_protected_scope : Warning<
+  "illegal indirect goto in protected scope, unknown effect on scopes">,
+    InGroup<DiagGroup<"label-address-scope">>;
 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">, InGroup<DiagGroup<"label-address-scope">>;
index 1df0186d9027a503e7feb694fc389fafc8581d1a..6f8640255a9ed3cdde9fd3a268e0f1cd696fc324 100644 (file)
@@ -140,7 +140,7 @@ L2: ;
 
 L3:
 L4:  
-  goto *P;  // expected-error {{illegal indirect goto in protected scope, unknown effect on scopes}}
+  goto *P;  // expected-warning {{illegal indirect goto in protected scope, unknown effect on scopes}}
   goto L3;  // ok
   goto L4;  // ok