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

Boris Carvajal <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #4 from Boris Carvajal <[email protected]> ---
The temporary variable also disappears when there's a postblit.

AST generated when a postblit or copy constructor is present:

    S s = (true) ? s = 0 , s.this(1) : (s = 0 , s.this(0));

In the original case:

    S s = (true) ? (S(0)).this(1) : (S(0)).this(0);

Looks like a frontend bad decision, there's no reason to not generate the
equivalent code to a simple assignment. For example:

    S s = S(1);

generates:

    S s = s = 0 , s.this(1);

--

Reply via email to