[Issue 20299] New: checkaction=context no working with temporary destructors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 14 13:31:18 UTC 2019


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

          Issue ID: 20299
           Summary: checkaction=context no working with temporary
                    destructors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

Asserts with temporary values dont compile with -checkaction=context if they
have an desctructor which is not [ @nogc @safe nothrow pure ].

------------------------------------------

module check;

struct Bad {

        ~this() @system {}
}

void main() {
        assert(Bad() == Bad());
}

------------------------------------------

dmd -c -checkaction=context check.d
> pure function _d_assert_fail cannot call impure destructor check.Bad.~this
> @safe function _d_assert_fail cannot call @system destructor check.Bad.~this
>  @nogc function _d_assert_fail cannot call non- at nogc destructor check.Bad.~this
> nothrow function _d_assert_fail may throw; destructor check.Bad.~this is not nothrow

------------------------------------------

This is caused by the explicit attributes (@nogc @safe nothrow pure) on
__d_assert_fail introduced 
[1].

[1] https://github.com/dlang/druntime/pull/2479

--


More information about the Digitalmars-d-bugs mailing list