diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-05 20:38:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-05 20:38:02 +0000 |
commit | 02db31c62ae6c68b5cbbecd09acbbc09bc03d110 (patch) | |
tree | 810b5bfd75c42c2474cfbbb354ccbe3949a1e146 | |
parent | fc3a0700bd63716b89eaabfd6a3da34019ffdb2e (diff) |
Emit warning on indirect goto that potentially violates
scope instead of error, PR6517
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97826 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 5 | ||||
-rw-r--r-- | test/Sema/scope-check.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 01317de1b2..badd64c31b 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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">>; diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index 1df0186d90..6f8640255a 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -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 |