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

RazvanN <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #2 from RazvanN <[email protected]> ---
(In reply to Temtaime from comment #0)

As moonlightsentinel highlighted, the variable is destroyed only once. The code
in main is roughly translated to this:

void main()
{
    S tmp;
    auto s = (true ? tmp = S(1) : tmp = S(0); tmp);
    tmp.__dtor;
    s.__dtor;
}

This is the intended behavior. Closing as invalid.

--

Reply via email to