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

Chris Lattner sabre at nondot.org
Fri Mar 5 12:38:03 PST 2010


Author: lattner
Date: Fri Mar  5 14:38:02 2010
New Revision: 97826

URL: http://llvm.org/viewvc/llvm-project?rev=97826&view=rev
Log:
Emit warning on indirect goto that potentially violates 
scope instead of error, PR6517

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=97826&r1=97825&r2=97826&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Mar  5 14:38:02 2010
@@ -1587,8 +1587,9 @@
 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">>;

Modified: cfe/trunk/test/Sema/scope-check.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/scope-check.c?rev=97826&r1=97825&r2=97826&view=diff
==============================================================================
--- cfe/trunk/test/Sema/scope-check.c (original)
+++ cfe/trunk/test/Sema/scope-check.c Fri Mar  5 14:38:02 2010
@@ -140,7 +140,7 @@
 
 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
   





More information about the cfe-commits mailing list