version (A)
{
void foo(scope void delegate() fn) nothrow
{
fn(); // Error: 'fn' is not nothrow
}
}
else version (B)
{
void foo(scope void delegate() fn) nothrow
{
asm { }
fn(); // Error: 'fn' is not nothrow
}
}
else version (C)
{
void foo(scope void delegate() fn) nothrow
{
asm { nop; }
fn(); // Works !?!
}
}
This sort of weird behaviour is found in druntime.
https://github.com/D-Programming-Language/druntime/blob/dbf3ff2a98208b21ee2d820df2c526af75ace863/src/core/thread.d#L2230
GDC does the right thing and errors, so until:
1) Druntime is fixed
2) DMD is fixed to error as it should
This is a blocker for 2.066
Comment #1 by ibuclaw — 2014-09-28T11:52:40Z
To work around the remainding issue around the relationship DMD has with nothrow and it's own inline assembler, I've had to comment out the following in GDC's extended assembler passes.
https://github.com/D-Programming-Language/dmd/pull/4030
Not good.