www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13530] New: [REG 2.066] D Inline Assembler in nothrow

https://issues.dlang.org/show_bug.cgi?id=13530

          Issue ID: 13530
           Summary: [REG 2.066] D Inline Assembler in nothrow function
                    hides errors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

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

--
Sep 24 2014