I have some code that I've inherited from someone very clever where they like to use gotos to leave the try block, jumping completely around the catch blocks.
It definitely works, and I suspect this is legal (I think that the C++ standard says that on exit from a scope, everything gets cleaned up properly, and I assume that applies to whatever the compiler had to do to implement exceptions on my platform).
Is this really legit? It's NOT something I'd ever write (it's too clever by half), but it's clearly working, and I just want to understand why this is OK.