@@ -4814,29 +4814,9 @@ class cppfront
4814
4814
4815
4815
// Emit the initializer if it it isn't '_' (don't care) and ...
4816
4816
if (initializer == " _" ) {
4817
- // I'll walk the walk: I've said publicly that _structured_ goto is perfectly
4818
- // kosher -- it's only _unstructured_ goto that's harmful (and Dijkstra knew it),
4819
- // which means:
4820
- // - jumping into a block or statement (I'm looking at you, Duff's Device)
4821
- // - jumping backwards (that's an unstructured loop == spaghetti control flow)
4822
- // - jumping across a variable declaration (C++ already bans this)
4823
- //
4824
- // But jumping forward-and-outward, skipping no declarations, is righteous.
4825
- //
4826
- // Here, using goto is the right tool for the job, and is better code because:
4827
- // - it avoids a gratuitous extra level of nesting inside an
4828
- // 'if (initializer != "_")' block of the next 100 lines (and please don't
4829
- // start the other diatribe about that the next 100 lines should be a
4830
- // separate named function - no it shouldn't)
4831
- // - which extra indent of identical code would make GitHub's diff for this
4832
- // commit super hard to read (diff does not deal well with blocks of code
4833
- // that simply change indentation level - in fact seeing that diff without
4834
- // the goto was the tipping point to just switch to goto here)
4835
- // ... but sadly I feel the need to defend it.
4836
- //
4837
- // As Scott would say (and has said), "so sue me"
4838
- //
4839
- goto skip_initializer;
4817
+ // And on to the next data member...
4818
+ ++object;
4819
+ continue ;
4840
4820
}
4841
4821
4842
4822
if (initializer.empty ()) {
@@ -4934,8 +4914,6 @@ class cppfront
4934
4914
separator = " , " ;
4935
4915
}
4936
4916
4937
- skip_initializer: ;
4938
-
4939
4917
// And on to the next data member...
4940
4918
++object;
4941
4919
}
0 commit comments