[Issue 24466] `scope(exit)` should not be allowed in the main scope of `noreturn` functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 29 07:18:37 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24466
elpenguino+D at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |elpenguino+D at gmail.com
--- Comment #1 from elpenguino+D at gmail.com ---
I don't think it's accurate to do that for all noreturn scopes. Consider:
```
noreturn v(int a) {
scope(exit) a++;
{
scope(exit) a++;
}
throw new Exception("Exception");
}
```
In this code, both scope guards should be executed.
--
More information about the Digitalmars-d-bugs
mailing list