https://issues.dlang.org/show_bug.cgi?id=21694
--- Comment #2 from Răzvan Ștefănescu <[email protected]> --- The error message is not swallowed because the code is lowered in a 'try {goto} finally', therefore there is no b declaration to jump over in the same scope as goto after lowering. If you replace the goto with a simple return, it is allowed. Skipping b declaration is perfectly legit as long as b destructor is skipped, that's how the return instruction will be lowered: void test(int x) { A a = 0; try { return; } finally a.~this(); A b = 0; b.~this(); } The problem is that the original code is lowered to: void test(int x) { A a = 0; try { goto END; } finally a.~this(); A b = 0; END: b.~this(); } instead of the correct lowering: void test(int x) { A a = 0; try { goto END; } finally a.~this(); A b = 0; b.~this(); END: } By the way, the C++ compiler (MSVC) lowers the same code like this, which is fine: void test(int x) { { A a = {}; ~a; goto END: } A b = {}; ~b; END:; } --
