Hello,
I'm not sure whether I'm missing something obvious here, but is there a reason for scope(success) being lowered to a try-catch statement? I would have expected only scope(exit) and scope(failure) to actually interact with exception handling, while scope(success) simply places code on the path of normal control flow.

Example (windows x32):

---

// main.d
void main() {
        scope(success) {}
}

dmd -betterC main.d
Error: Cannot use try-catch statements with -betterC

---

Regardless of whether -betterC is used, you can see in the disassembly that having a scope(success) anywhere in the function causes the SEH prologue to be emitted in the code.

Is there a reason scope(success) needs to set up for exception handling?
Or is this a bug / potential enhancement ?

Reply via email to