http://d.puremagic.com/issues/show_bug.cgi?id=10789


Maxim Fomin <ma...@maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ma...@maxim-fomin.ru


--- Comment #2 from Maxim Fomin <ma...@maxim-fomin.ru> 2013-08-10 00:44:27 PDT 
---
Reduced:

extern(C) int printf(const char*, ...);

struct S {
    static int count;

    this(int ignoreme)
    {
      int oldcount = count;
        printf("%X ctor %d=>%d\n", &this, oldcount, ++count);
    }

    ~this()
    {
      int oldcount = count;
        printf("%X dtor %d=>%d\n", &this, oldcount, --count);
    }

    this(this)
    {
      int oldcount = count;
        printf("%X postblit %d=>%d\n", &this, oldcount, ++count);
    }
}

S fun()
{
   S s1 = S(42), s2 = S(24);
    if (true) return s1;
   else return s2;
}

void main()
{
   S s = fun();
}

In case of if(true) compiler does not insert postblit call.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to