forked from OSchip/llvm-project
Emit warning on indirect goto that potentially violates
scope instead of error, PR6517 llvm-svn: 97826
This commit is contained in:
parent
27494232d4
commit
b2bc4b9880
|
@ -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">>;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue