gcc 4.3.0 issues warnings for the unreachable code on lines 7 and 9 below but fails to issue one for line 17.
$ cat -n t.C && g++ -Wunreachable-code -c t.C 1 int f () 2 { 3 int i = 0; 4 5 if (i == 0) return 0; 6 7 throw i; // unreachable, warning 8 return 1; // unreachable, warning 9 } 10 11 int g () 12 { 13 int i = 0; 14 15 if (i == 0) return 0; 16 17 return 1; // unreachable, no warning 18 } 19 t.C: In function int f(): t.C:7: warning: will never be executed t.C:8: warning: will never be executed -- Summary: missing warning on unreachable return statement Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sebor at roguewave dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37062