I presume that the C++ standard requires this to be an error: int foo(int arg){ goto Hell; int i = arg; Hell: return arg; // or using i here }
Especially in the case of plain old data (no constructor, etc.) this behavior is needlessly incompatible with C. Please require -pedantic -std=c++98 for such unfriendly behavior. -- Summary: goto crossing P.O.D. initialization Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: acahalan at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27235