Skip to content
Snippets Groups Projects
Commit a7dc5980 authored by Marek Polacek's avatar Marek Polacek
Browse files

re PR c/49859 (gcc could warn about statements between "switch" and first "case")

	PR c/49859
	* common.opt (Wswitch-unreachable): New option.
	* doc/invoke.texi: Document -Wswitch-unreachable.
	* gimplify.c (gimplify_switch_expr): Implement the -Wswitch-unreachable
	warning.

	* c-c++-common/Wswitch-unreachable-1.c: New test.
	* gcc.dg/Wswitch-unreachable-1.c: New test.
	* c-c++-common/goacc/sb-2.c (void foo): Add dg-warning.
	* g++.dg/cpp0x/lambda/lambda-switch.C (main): Likewise.
	* g++.dg/gomp/block-10.C: Likewise.
	* gcc.dg/gomp/block-10.c: Likewise.
	* g++.dg/gomp/block-9.C: Likewise.
	* gcc.dg/gomp/block-9.c: Likewise.
	* g++.dg/gomp/target-1.C: Likewise.
	* g++.dg/gomp/target-2.C: Likewise.
	* gcc.dg/gomp/target-1.c: Likewise.
	* gcc.dg/gomp/target-2.c: Likewise. 
	* g++.dg/gomp/taskgroup-1.C: Likewise.
	* gcc.dg/gomp/taskgroup-1.c: Likewise.
	* gcc.dg/gomp/teams-1.c: Likewise.
	* g++.dg/gomp/teams-1.C: Likewise.
	* g++.dg/overload/error3.C: Likewise.
	* g++.dg/tm/jump1.C: Likewise.
	* g++.dg/torture/pr40335.C: Likewise.
	* gcc.dg/c99-vla-jump-5.c: Likewise.
	* gcc.dg/switch-warn-1.c: Likewise.
	* gcc.dg/Wjump-misses-init-1.c: Use -Wno-switch-unreachable.
	* gcc.dg/nested-func-1.c: Likewise.
	* gcc.dg/pr67784-4.c: Likewise.

From-SVN: r236597
parent 7e5a3c96
No related branches found
No related tags found
No related merge requests found
Showing
with 279 additions and 25 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment